How to make navigation bar really full width and static - wordpress

I have absolutely no experience in programming, html, css or anything.
Still, i want to make some kind of website and I'm struggling with several issues right at the beginning.
For starters, my wordpress theme lets me have full width navigation bar without touching any code.
Okay, but i want to have a full width drop shadow effect under the navigation bar. This just doesn't happen and no matter where i try to dig the problem, i just can't do it.
the link to my website.
As you can see, the drop shadow doesn't go full width.
I've seen sites which use the effect so it should be possible. Is it a problem with my theme, should i just forget about it?
(And yeah, the site's really ugly but i'm planning to update it when i have time)

In your CSS You need to remove the boxshadow from div id="navigation" and add it to div id="nav-container"
something like this:
#nav-container {
-webkit-box-shadow: 0 5px 14px rgba(0, 0, 0, 0.7);
box-shadow: 0 5px 14px rgba(0, 0, 0, 0.7);
}

Wrap your nav-container div with another div and apply the drop shadow effect to it. After applying the change code looks something like below
<div class="shadow">
<div id="nav-container">
.....
</div>
</div>
then shadow class in css should be like this
.shadow{
box-shadow: 0 5px 14px rgba(0, 0, 0, 0.7);
}

Related

css3 multiple shadows from different rules

Is it possible for css3 multiple shadows to be accumilated from different css rules / classes ?
i.e.
.multipleShadows {box-shadow: 0 0 10px 5px black, 40px -30px lime}
will create two shadows for the element, black and lime.
but I want to have two different classes - one for blackShadow and one for limeShadow
.blackShadow {box-shadow: 0 0 10px 5px black}
.limeShadow {box-shadow: 40px -30px lime}
and have both applied to a single element that has both classes.
<div class="blackShadow limeShadow">my div</div>
Can this be done?
Are there alternate ways that can achieve this goal?
Thanks.
Write like this:
.blackShadow.limeShadow {box-shadow: 0 0 10px 5px black, 40px -30px lime}
There isn't exactly a better method to do this other than make a separate class like .doubleShadow or to write another style for .blackShadow .limeShadow.
You can use LESS and make a mixin which you can then implement. That will be a better option if you are looking for a different solution.
Regardless of that I made a fiddle of what you have given in the question.
I ended up using an extra div placed inside the original div and applied the second shadow class to the internal div.
<div class="blackShadow"><div class="limeShadow"> my div</div></div>
This was chosen becuase it keeps the definitions of the shadow classes separate and still allows me to show both the shadows at the same time.

Can I have an inset shadow along the bottom of a div only?

Can I have an inset shadow along the bottom of a div only? I've been playing with the box-shadow property in CSS3 for a while and cant figure out how to go about doing this.
I can get it to show on the inside along the top of the div but cant figure out how to get it to the bottom. I haven't been able to find any topics relating to this.. is it possible?
box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.4);
Use negative distances to more the shadow to the left or up (therefore having them on the right and bottom edges for inset shadows).

How to apply an inner stroke to an image with just CSS?

Given a photo like so:
How can I apply an inner stroke as seen below which in photoshop is done with an inner shadow? Suggestions?
There’s an inset property on various browsers’ box-shadow attributes that makes it behave much like Photoshop’s “inner shadow”. You’ll need to create an element on top of your image with the same size and appropriate corner rounding attributes (border-radius, -webkit-border-radius, -moz-border-radius), then apply the shadow to it something like this:
-webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
-moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
(note edits; I fiddled with it a bit and it turns out the shadow gets drawn beneath any actual content of the element, so you’ll either need to apply the shadow to an element that’ll be layered on top of the image or put the image in the background of the element that has the shadow applied to it)
(further edit: a working JSfiddle example.)

box-shadow and 100% Fluid Width Issue

I've been polishing up a page I built over the past day or two and have run into an issue after using box-shadow - I was hoping someone might shed some light on an easy way to fix this.
The Setup:
I have a div that has a few properties, including width, max-width, and box-shadow.
#mydiv {
width:100%;
max-width:1200px;
-webkit-box-shadow: 0px 0px 20px rgba(0, 0, 0, 1);
-moz-box-shadow: 0px 0px 20px rgba(0, 0, 0, 1);
box-shadow: 0px 0px 20px rgba(0, 0, 0, 1);
}
The Problem:
The "box-shadow" property adds 40px to the width of the div element - 20px on each side. When a screen is small enough that the content should hit the 100% width attribute, we see a horizontal scroll-bar. After digging through the CSS I discovered it was because the div was technically something more like width: 100% + 40px;
What I've Tried:
I've considered setting overflow:hidden on the parent div, but I do have a min-width set that would then make content inaccessible. I've also tried using a percentage for the size argument in the box-shadow CSS - 1% for example - and then setting the div's width to 98% - but the box-shadow CSS doesn't seem to accept a percentage for its size. I also have considered using javascript to test the browser width and then display or hide the box-shadow element accordingly, but it doesn't seem like the optimal solution.
There has to be a simpler way to handle this. Thoughts?
It's a browser bug.
The spec used to be unclear about this, but wording has since been added to clarify that shadows shouldn't trigger scrolling:
Shadows do not trigger scrolling or increase the size of the scrollable area.
But as a result of this earlier omission, most browsers did trigger scrolling for shadows. This has now been fixed in all recent browsers.
In older browsers, you'll either have to live with the scrollbars, add overflow-x: hidden to your #mydiv and hope it doesn't break anything, or find another way to add shadows (e.g. using good old PNGs).
Also see the following two related questions:
Firefox & CSS3: using overflow: hidden and box-shadow
CSS box shadow on container div causes scrollbars
There's a workaround to the problem of scroll bars in fluid width sites with box shadow.
If you add an #media instruction in your CSS you can detect when the browser window is at a certain width (modern browsers support this and IE9 should too).
For example, for a centered pagewrap div with a max-width set to 940px, try adding this to your stylesheet:
#media screen and (min-width: 998px) {
div#pagewrap {
-moz-box-shadow: 3px 8px 26px #a1a09e;
-webkit-box-shadow: 3px 8px 26px #a1a09e;
box-shadow: 3px 8px 26px #a1a09e;
} }
The min-width of 998px in the #media css is to make the drop shadow disappear just before it triggers the scroll bar.

Floated divs: Can you drop shadow them?

Im creating a website that has three columns of content.....
navigation float: left;
main content centered
right column float: right;
Is it possible to drop shadow all three of these areas.
I tried and it didn't work wondering if the divs prohibit the end result?
There are various ways of doing background shadows
1) To give background url as drop shadow image for the div and give some margin-left:5px which makes show like a drop shadow.
2) to get four images like topright , right ,bottomright,bottom image and position them one by one after the divs.
choose whatever is easy for you and it should work perfect. See the below linke for some exampel
http://www.alistapart.com/articles/cssdropshadows/
we implemented drop shadows at the following location for images
http://www.art.com/gallery/id--b1823/animals-posters.htm?ui=E1E1ADDF1A034D5D9A89DB0A8E318263
with firebug you can see how we implemented , its the second approach.
let me know if you have more questoins.
Of course you can apply drop-shadow to all of these at the same time, one solution if your ok with the browser support listed here http://caniuse.com/css-boxshadow is to simple just use CSS3 box shadow.
just simple target all three selectors of your containers like so.
.container-left, .container-middle, .container-right { }
then apply box shadow like so (dont forget browser prefixes)
and I'm using RGBA so we get to set the Alpha transparency as well, but you could use HSLA also.
.container-left, .container-middle, .container-right {
-webkit-box-shadow: 0 0 9px rgba(20, 0, 0, 0.53);
-moz-box-shadow: 0 0 9px rgba(20, 0, 0, 0.53);
box-shadow: 0 0 9px rgba(20, 0, 0, 0.53);
}
Hope this was helpful.

Resources