Trying to add header via css is repeating - css

I am trying to place this header in the css but without luck i tried placing it in width container but its just repeating itself.
background:url(http://outpostmotorsports.com/OPMSwordpress/wp-content/uploads/2015/09/Y5a5qUNx6jvD9pN6AH5VMslP656QnElptjDvGKR65Fk.jpg) no-repeat;
Edit to add css code
.width-container, .flex-caption .slider-container {-moz-transition: all
.2s ease-in-out; -webkit-transition: all .2s ease-in-out;
background:url(http://outpostmotorsports.com/OPMSwordpress/wp-content/uploads/2015/09/Y5a5qUNx6jvD9pN6AH5VMslP656QnElptjDvGKR65Fk.jpg) no-repeat;}
If you look at the source in css you will c width container at line 41
I trying to add the header for all pages from here
http://outpostmotorsports.com/OPMSwordpress/inventory/1989-harley-davidson-sportster/
Note 2
Its still showing it three times

Try it like this:
background:url(http://outpostmotorsports.com/OPMSwordpress/wp-content/uploads/2015/09/wp_header.jpg)
background-repeat: no-repeat;
The background-repeat property sets if/how a background image will be
repeated.
By default, a background-image is repeated both vertically and
horizontally.
Tip: The background image is placed according to the
background-position property. If no background-position is specified,
the image is always placed at the element's top left
Source: (w3schools)
Good luck!

If you are using this code
.width-container,
.flex-caption .slider-container {
-moz-transition: all
.2s ease-in-out;
-webkit-transition: all .2s ease-in-out;
background:url(http://outpostmotorsports.com/OPMSwordpress/wp-content/uploads/2015/09/Y5a5qUNx6jvD9pN6AH5VMslP656QnElptjDvGKR65Fk.jpg) no-repeat;
}
then you are adding the background image to more than one element.
I'd suggest you try adding a new rule:
.width-container{
background:url(http://outpostmotorsports.com/OPMSwordpress/wp-content/uploads/2015/09/Y5a5qUNx6jvD9pN6AH5VMslP656QnElptjDvGKR65Fk.jpg) no-repeat;
}

Related

Overlapping image caught behind next image

I'm sure this is a pretty simple one but can't find the specific answer I'm looking for elsewhere.
Basically, I have a series of side by side images set out in a responsive grid layout. As you hover over each image it zooms and scales the image bigger so it looks like it's coming out towards you.
However, the issues I have is that the later image always overlaps the prior image. I have tried setting all the divs containing the image to the same z-index but to no avail.
I have setup a js.fiddle which demonstrates the issue. I'm hoping to solve with purely CSS.
JSfiddle link http://jsfiddle.net/Aloha_Design_Co/46poxw9j/
Any ideas would be most appreciated.
Thanks,
Heath
Simply, give more z-index in .photo-content:hover.
.photo-content:hover {
background-size: 120%;
/* in conjuction with the transition below it zooms in on the background image - doesn't change box size in itself; */
-webkit-transition: all 0.5s linear;
-moz-transition: all 0.5s linear;
transition: all 0.5s linear;
transform: scale(1.2);
/* expands the box to look like it is 3D coming out of page */
/* Add z-index */
z-index: 10;
}
Jsfiddle

Replace Image with Background Image on Small Screens

A site I'm working is in need of a page for an upcoming event that's a bit of a one-off. Most pages have a mast banner image in the template that spans the full width of the page. On most pages this image just shrinks on small screens. However, on this new page it's a requirement that it switch to a different image at a certain width.
Since this site is in Drupal, I'm a bit hesitant to modify the theme for this one temporary page. Ideally, I'd like to be able to set the default image so that it includes the standard region used in the rest of the site.
If I included the image, would it then be appropriate on small screens, when the image needs to switch, to set display: none; on the <img> and apply a background image to the container div? I think this would work but it seems like a bit of a workaround.
Is there a better way around this?
The image region is simply an <img> nested in a series of <divs>.
The work around you mention is quiet easy to achieve. In this FIDDLE I have just added:
#media (max-width: 600px) {
img {
opacity:0;
position:relative;
z-index:-1;
-webkit-transition: all 0.3s linear;
-moz-transition: all 0.3s linear;
-ms-transition: all 0.3s linear;
-o-transition: all 0.3s linear;
transition: all 0.3s linear;
}
just to make a transition but a simple display none is as valid while you can add the background image to the image container div. (the z-index is to set the image behind whatever content you may have in the div, specially links)

Is there a CSS animation for a floating div that wraps on window resize?

If I have a series of divs all with float: left and I resize the browser so they wrap, can I animate their transition to their new location using only CSS animations (no JavaScript)?
Without using JavaScript that's most likely a no...
CSS transitions and animations rely on the elements' CSS properties changing. The line wrap behavior you're seeing when the window is resized doesn't change the elements' properties, so you won't have anywhere to add a transition.
Even with JavaScript I doubt creating the effect you're after would be trivial, you may want to check out a plugin like Masonry
You can try use transistions, but I think that in your example it's not possible without JS.
-webkit-transition: all 0.3s;
-moz-transition: all 0.3s;
-o-transition: all 0.3s;
-ms-transition: all 0.3s;
transition: all 0.3s;

CSS3 fade in for sticky menu

Okay so what I'm trying to do should be pretty simple (I hope).
I am using a wordpress plugin for my menu and an extension to make it sticky. My menu isn't at the top already, it is below another container, so it becomes sticky when the menu container reaches the top of the browser screen (as it should).
I have a menu item that is hidden when the menu is "not sticky" and then it becomes visible when it is "sticky." Everything works perfectly, however now I want to add a fade in effect preferably only using CSS3 (for simplicity of integration). So the fade in effect should take place when the visibility become visible (see code below, but basically when the menu becomes sticky)
My custom class for the menu item is ".jrm-um-sticky-only"
Here is my code to achieve the appearing/disappearing menu item:
#megaMenu ul.megaMenu li.jrm-um-sticky-only{
display: block !important;
visibility: hidden !important;
opacity: 0 !important;
}
#megaMenu-sticky-wrapper #megaMenu.ubermenu-sticky li.jrm-um-sticky-only{
display: block !important;
visibility: visible !important;
opacity: 1 !important;
}
I tried adding:
-webkit-transition: visibility 0.2s linear, opacity 0.2s linear;
-moz-transition: visibility 0.2s linear, opacity 0.2s linear;
-o-transition: visibility 0.2s linear, opacity 0.2s linear;
to the last selector above (where the opacity is 1), but it didn't work. I also tried setting opacity to 0 along with the above transition code but no avail.
I'm a newbie so sorry if there are errors in my approach here. (not sure if I need the opacity at 0 if the visibility is hidden???)
Thanks!!!!
Maybe you should add your transition rules to the first block
(#megaMenu ul.megaMenu li.jrm-um-sticky-only)

Buggy blink effect with CSS multiple transition when use 'all' property

I have a problem with the CSS transition property.
I need to declare two transitions for a section-tag. Every transition with the section should have a duration of 1s, only the background should have a duration of 0.3s
So my CSS-transition code would look like that:
section{
background: black;
transition: all 1s ease, background 0.3s ease;
}
section:hover{
background: green;
transform: translateY(100px);
}
But when I hovering the link now, the background get animated in 1s and it blinks strangely.
Here the codepen Demo
Someone know why this happend? And how can I realize my goal?
And yes, I need the all property!
EDIT
Just found a strange one. In the linked codepen above, it blinks. But when I animate also the padding, it stop blinking! But the background will be animated in 1s...
Here's the second demo
I have tried this in code pen, the problem not in the transition property.
Better you use div tag for the link background and create separate transition for that.
Surely div tag will give the best solution for your problem.
The problem occurred because as you hover over the element, it starts moving downwards.
When the element is not hovered, it would revert back.
Now as you hover, the elements starts moving and then loses the hover immediately which causes it to return to original state but again gains the hover effect as it again receives the mouse-over event which also cause blink, and the strange phenomenon you observed.
If you place mouse close towards the bottom, you observe the desired effect.
The fix should be that you write a hover for the container that contains these elements and apply the effect to these elements.
Besides you've applied transition in only 1 state which also may be the reason for blink;
try using transitions to both the statements like below:
section{
width:300px;
height:300px;
background:black;
color:white;
transition: background 0.3s ease, all 3s ease;
}
section:hover{
background:green;
transition: background 0.3s ease, all 3s ease;
}

Resources