CSS: Menu Bar and content styling issues - css

I am currently adding a navigation bar to a web page. But I am running into some css styling issues. The navigation menu bar is pushing the content below, leaving a huge gap in between and making it uneven. I took the precaution in leaving out anything that will mess with the bottom like margin bottom-padding but I am still getting the same result. How can I get the menu bar to not affect the content below? EXAMPLE
With the Navigation bar added:
Without navigation bar the contents below are even:
I have added the specific css rules that are causing the issue to devgrow.css:
<style>
#navigation {
position:relative;
top:-45px;
left:450px;
}
#au_title {
color: #FC821D;
font-size: 120%;
font-weight: bold;
left: 515px;
letter-spacing: 2px;
position: relative;
text-transform: uppercase;
top: -105px;
}
#searchInput {
left: 700px;
position: relative;
top: -180px;
}
#contentNav { color: #cfdae3; }
/* Dark Button CSS */
.buttonNav {
outline: 0;
padding: 5px 12px;
display: block;
color: #EBEBEB;
font-weight: bold;
text-shadow: 1px 1px #1f272b;
border: 1px solid #1c252b;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
background: #232B30; /* old browsers */
background: -moz-linear-gradient(top, #3D4850 3%, #313d45 4%, #232B30 100%); /* firefox */
background: -webkit-gradient(linear, left top, left bottom, color-stop(3%,#3D4850), color-stop(4%,#313d45), color-stop(100%,#232B30)); /* webkit */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#3D4850', endColorstr='#232B30',GradientType=0 ); /* ie */
box-shadow: 1px 1px 1px rgba(0,0,0,0.2); /* CSS3 */
-moz-box-shadow: 1px 1px 1px rgba(0,0,0,0.2); /* Firefox */
-webkit-box-shadow: 1px 1px 1px rgba(0,0,0,0.2); /* Safari, Chrome */
}
.buttonNav:hover {
color: #fff;
background: #4C5A64; /* old browsers */
background: -moz-linear-gradient(top, #4C5A64 3%, #404F5A 4%, #2E3940 100%); /* firefox */
background: -webkit-gradient(linear, left top, left bottom, color-stop(3%,#4C5A64), color-stop(4%,#404F5A), color-stop(100%,#2E3940)); /* webkit */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#4C5A64', endColorstr='#2E3940',GradientType=0 ); /* ie */
}
.buttonNav:active {
background-position: 0 top;
position: relative;
top: 1px;
color: #fff;
padding: 6px 12px 4px;
background: #20282D; /* old browsers */
background: -moz-linear-gradient(top, #20282D 3%, #252E34 51%, #222A30 100%); /* firefox */
background: -webkit-gradient(linear, left top, left bottom, color-stop(3%,#20282D), color-stop(51%,#252E34), color-stop(100%,#222A30)); /* webkit */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#20282D', endColorstr='#222A30',GradientType=0 ); /* ie */
-moz-box-shadow: 1px 1px 1px rgba(255,255,255,0.1); /* Firefox */
-webkit-box-shadow: 1px 1px 1px rgba(255,255,255,0.1); /* Safari, Chrome */
box-shadow: 1px 1px 1px rgba(255,255,255,0.1); /* CSS3 */
}
/* Other stuff: */
.button-list { list-style: none; width: 100%; float: left; display: block; }
.button-list li { float: left; margin: 0 5px 0 0; }
.button-list li.search { padding-left: 18px; margin-left: 10px; position: relative; }
/* Search CSS: */
.search-input {
padding: 0 5px 0 22px;
border: 2px solid #DADADA;
height: 30px;
font-size: 12px;
line-height: 30px;
border-radius: 25px;
-moz-border-radius: 25px;
-webkit-border-radius: 25px;
background: #FFF; /* old browsers */
}
.search-input:focus {outline: none;}
.search-submit {
width: 13px;
height: 13px;
border: none;
background: url(images/mag-glass.png) no-repeat;
display: block;
position: absolute;
left: 26px;
top: 10px;
text-indent: -9999em;
}
</style>

First i have say that the coding is really bad. For fixed that issue remove float from you button-list. Write like this :
.button-list {
list-style: none outside none;
overflow: hidden;
}

Hey now define overflow hidden in your css #contentArea id
as like this
#contentArea {
overflow: hidden;
}

Add style clear both in css of first content area
<div id="contentArea" style="clear:both">

Related

Why can't I get a CSS button with Icon and no image?

I try to make into my button a css icon and not with image, and here is my css button :
Button :
<div>
<b>
<asp:Button ID="bt_VaildID" runat="server" Text="Valider" OnClick="bt_VaildID_Click" ValidationGroup="auGoup" CausesValidation="true" CssClass="bt_Valider" />
</b>
</div>
CSS:
.bt_Valider {
display: inline-block;
border: 2px solid #903E71;
color: #000000;
border-radius: 0;
-webkit-border-radius: 0;
-moz-border-radius: 0;
font-family: Verdana;
width: auto;
height: auto;
font-size: 16px;
padding: 6px 25px;
background-image: linear-gradient(to top, #903E71, #903E71);
background-image: -webkit-linear-gradient(to top, #903E71, #903E71); /* for safari */
background-color: #903E71;
float:right;
}
.bt_Valider:hover, .bt_Valider:after {
border: 2px solid #903E71;
color: #903E71;
background-image: linear-gradient(to top, #FFF, #FFF);
background-image: -webkit-linear-gradient(to top, #FFF, #FFF); /* for safari */
cursor:pointer;
content: "\279C"; /* I found that with this i can make some icon */
}
This code gives me this result : Output image
But I want to get it like this : Desired
not sure if this is your desired result.
be aware that with content: "\279C"; you are using an unicode character, se more here http://tutorialzine.com/2014/12/you-dont-need-icons-here-are-100-unicode-symbols-that-you-can-use/
.bt_Valider {
display: inline-block;
border: 2px solid #903E71;
color: #000000;
border-radius: 0;
-webkit-border-radius: 0;
-moz-border-radius: 0;
font-family: Verdana;
width: auto;
height: auto;
font-size: 16px;
padding: 6px 25px;
background-image: linear-gradient(to top, #903E71, #903E71);
background-image: -webkit-linear-gradient(to top, #903E71, #903E71); /* for safari */
background-color: #903E71;
/* float:right; */
}
.bt_Valider:hover, .bt_Valider:after {
/* border: 2px solid #903E71; */
color: #000000;
cursor:pointer; background:transparent;
content: "\279C"; /* I found that with this i can make some icon */
}
<div>
<b>
<Button ID="bt_VaildID" runat="server" Text="Valider" OnClick="bt_VaildID_Click" ValidationGroup="auGoup" CausesValidation="true" Class="bt_Valider" >Valider</Button>
</b>
</div>

Firefox, Opera position: absolute

This is a structure of my site:
<html>
<body>
<embed flash>
<div id='dialog'>
<div width="500px" height="300px"><iframe/></div>
</div>
</body>
</html>
<style type="text/css">
.hide { display: none; }
.show { display: block; }
iframe { border: 0; }
#dialog { background-color: rgba(0,0,0,0.5); position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 100; }
#dialog .dialog-inside { width: 650px; -webkit-box-shadow: 0px 0px 30px 0px rgba(50, 50, 50, 0.54); -moz-box-shadow: 0px 0px 30px 0px rgba(50, 50, 50, 0.54); box-shadow: 0px 0px 30px 0px rgba(50, 50, 50, 0.54); margin: auto; overflow: hidden; border-radius: 5px; }
#dialog .dialog-inside .dialog-header { position: absolute; right: 0; right: 1px; top: 3px; }
#dialog .dialog-inside .dialog-header .close { width: 23px; height: 23px; background: url("Images/close.png"); background-position: 2px 2px; background-repeat: no-repeat; border: 1px solid transparent; cursor: pointer; }
#dialog .dialog-inside .dialog-header .close:hover { background-color: #fdc985; border-color: #4040B1; }
#dialog .dialog-inside .dialog-bottom-wrapper { position: absolute; bottom: 0px; right: 0; left: 0; height: 42px; background-color: #f8f8f8; }
#dialog .dialog-inside .dialog-bottom-wrapper .dialog-bottom { float: right; margin: 8px 5px; }
#dialog .dialog-inside .dialog-bottom-wrapper .dialog-bottom .btn { background: rgb(251,251,249); /* Old browsers */ /* IE9 SVG, needs conditional override of 'filter' to 'none' */ background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZiZmJmOSIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNmM2YzZWYiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+); background: -moz-linear-gradient(top, rgba(251,251,249,1) 0%, rgba(243,243,239,1) 100%); /* FF3.6+ */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(251,251,249,1)), color-stop(100%,rgba(243,243,239,1))); /* Chrome,Safari4+ */ background: -webkit-linear-gradient(top, rgba(251,251,249,1) 0%,rgba(243,243,239,1) 100%); /* Chrome10+,Safari5.1+ */ background: -o-linear-gradient(top, rgba(251,251,249,1) 0%,rgba(243,243,239,1) 100%); /* Opera 11.10+ */ background: -ms-linear-gradient(top, rgba(251,251,249,1) 0%,rgba(243,243,239,1) 100%); /* IE10+ */ background: linear-gradient(to bottom, rgba(251,251,249,1) 0%,rgba(243,243,239,1) 100%); /* W3C */ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fbfbf9', endColorstr='#f3f3ef',GradientType=0 ); /* IE6-8 */ border: 1px solid #7f9db9; color: #333333; cursor: pointer; display: inline-block; margin-left: .5em; padding: 0px 12px; text-align: center; line-height: 20px; outline: none; border-radius: 3px; }
#dialog .dialog-inside .dialog-bottom-wrapper .dialog-bottom .btn:hover { background-color: #d1d1d1; border-color: #d1d1d1; color: #111; moz-transition: background-position 0.1s linear; ms-transition: background-position 0.1s linear; o-transition: background-position 0.1s linear; text-decoration: none; transition: background-position 0.1s linear; webkit-transition: background-position 0.1s linear; outline: none; }
#dialog iframe { display: block; height: 114px; }
</style>
The problem is dialog I set it position: absolute, left, top, bottom, right: 0, in Chrome, IE work fine, it's rendered full screen with black background. Opera, the dialog has width and height is fix with div child => it doesn't have fullscreen. In firefox, it like the same, but I hover on dialog in Inspect Mode, it show black background.
Anyone has the problem like that?
Try adding
height: 100%;
width: 100%;
on #dialog

IE8 pseudo :hover bug

Best way to explain you what i mean you can see on the video. Please pay attention to the cursor. For the first time I'm trying to optimize my website for IE8. I hope there is way to fix this. Thanks in advance !
http://www.youtube.com/watch?v=V0wQGcZKTvc - IE8 on the left, chrome on the right
CSS
.toggle:before {
position: absolute;
top: 0;
left: 0;
content: '';
width: 100%;
height: 5px;
z-index: 1;
}
.toggle:after {
position: absolute;
bottom: 0;
left: 0;
content: '';
width: 100%;
height: 5px;
z-index: 1;
}
.toggle h3 {
position: relative;
width: 100%;
height: 100%;
cursor: pointer;
color: #864747;
font-size: 14px;
padding: 10px 2px 10px 2px;
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==); /* 1x1px transparent gif */
}
.toggle-cont {
display: none;
position: relative;
padding-bottom: 10px;
text-shadow: -1px -1px rgba(240,238,224,1), 1px 1px rgba(240,238,224,1);
}
.tshadow:before {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
content: '';
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2Q2ZDRjOCIgc3RvcC1vcGFjaXR5PSIwLjkiLz4KICAgIDxzdG9wIG9mZnNldD0iNTAlIiBzdG9wLWNvbG9yPSIjZDZkNGM4IiBzdG9wLW9wYWNpdHk9IjAuNzUiLz4KICAgIDxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2Q2ZDRjOCIgc3RvcC1vcGFjaXR5PSIwLjI1Ii8+CiAgPC9saW5lYXJHcmFkaWVudD4KICA8cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIiBmaWxsPSJ1cmwoI2dyYWQtdWNnZy1nZW5lcmF0ZWQpIiAvPgo8L3N2Zz4=);
background: -moz-linear-gradient(top, rgba(214,212,200,0.9) 0%, rgba(214,212,200,0.75) 50%, rgba(214,212,200,0.25) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(214,212,200,0.9)), color-stop(50%,rgba(214,212,200,0.75)), color-stop(100%,rgba(214,212,200,0.25))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(214,212,200,0.9) 0%,rgba(214,212,200,0.75) 50%,rgba(214,212,200,0.25) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(214,212,200,0.9) 0%,rgba(214,212,200,0.75) 50%,rgba(214,212,200,0.25) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(214,212,200,0.9) 0%,rgba(214,212,200,0.75) 50%,rgba(214,212,200,0.25) 100%); /* IE10+ */
background: linear-gradient(to bottom, rgba(214,212,200,0.9) 0%,rgba(214,212,200,0.75) 50%,rgba(214,212,200,0.25) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e6d6d4c8', endColorstr='#40d6d4c8',GradientType=0 ); /* IE6-8 */
}
.toggle {
position: relative;
padding: 0 14px;
-moz-box-shadow: 0 0 3px rgba(68,68,68,0.3);
-webkit-box-shadow: 0 0 3px rgba(68,68,68,0.3);
box-shadow: 0 0 3px rgba(68,68,68,0.3);
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAMElEQVQIW2N89ODyfwYk8PXrNwZGZEGQADc3F0IQJgDSBFaJLAAWvH715H+QFmQAABDVHcpHFfxXAAAAAElFTkSuQmCC);
}
.tdivider {
display: none;
position: relative;
height: 1px;
width: 100%;
content: '';
background: rgba(170, 169, 162, 0.6);
border-bottom: 1px solid #f0eee0;
margin-bottom: 8px;
}
.tarrow {
position: absolute;
top: 14px;
right: 18px;
margin: 0 0 0 0;
width: 8px;
height: 14px;
content: '';
background: url("../img/arrow.png");
cursor: pointer;
}
DOM
<div class="toggle ">
<div class="tshadow">
<h3># Explanation</h3>
<div class="tarrow rotate2"></div>
<div class="tdivider"></div>
<div class="toggle-cont">
<ol>
<li>sadasd</li>
<li>asd</li>
<li>as</li>
<li>d</li>
<li>as</li>
</ol>
</div>
</div>
</div>
jQuery
$("#single-full-column div.tshadow h3").click(function(e) {
e.preventDefault();
$(this).parent().find($(".toggle-cont")).stop().slideToggle();
$(this).parent().find($(".tdivider")).stop().toggle("slow");
$(this).parent().find($(".tarrow")).stop().toggleClass("rotate1 rotate2");
});
..................................................................................
do not have IE8 to test, but I think what you can do is let your element with height and overall width, hope it helps

Drop down menu "broken" in Firefox and IE

I have a drop down menu that's working just fine in Chrome and Safari, but when testing it in Firefox and IE, the dropdown box is longer down and therefore unreachable.
<!--produkter dropdown -->
<div id="dropmenu1" class="dropmenudiv">
RAW Frames
PROJECT 321
CAMSPORTS
FOSS
</div>
<!--medie dropdown -->
<div id="dropmenu2" class="dropmenudiv" style="width: 113px;">
TEST RIDE
HOW TO
RIDERS VIEW
</div>
.dropmenudiv{
position: absolute;
margin-top: 36px;
border-bottom-left-radius: 5px 5px;
border-bottom-right-radius: 5px 5px;
border-left: 1px solid #333;
border-right: 1px solid #333;
border-bottom: 1px solid #333;
font-size: 12px;
font-weight: bold;
line-height: 26px;
z-index: 100;
background: -moz-linear-gradient(top, #424141, #262626); /* Mozilla */
background: -webkit-gradient(linear, left top, left bottom, from(#424141), to(#262626)); /* Chrome-Safari */
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#424141', endColorstr='#262626'); /* IE */
width: 137px;
visibility: hidden;
}
.dropmenudiv a{
width: auto;
display: block;
text-indent: 5px;
padding: 2px 0;
text-decoration: none;
color: black;
padding-left: 5px;
}
* html .dropmenudiv a{ /*IE only hack*/
width: 100%;
}
.dropmenudiv a:hover{
background: -moz-linear-gradient(top, #545454, #2c2c2c); /* Mozilla */
background: -webkit-gradient(linear, left top, left bottom, from(#545454), to(#2c2c2c)); /* Chrome-Safari */
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#545454', endColorstr='#2c2c2c'); /* IE */
}
I have read a lot around the net and can see that a lot of other people have similar problems with Firefox not showing the div the same place as in Chrome and other browsers.
The attribute position:absolute causes this issue. Try this code instead what you have used.
http://jsfiddle.net/AAgfF/2/

CSS multi border

I don't know why this doesn't show a extra border can you see what I'm doing wrong?
.loginSubmit {
width: 100px;
height: 100px;
background: #e0e0e0;
border: 1px solid #dedede;
color: #555555;
font-weight: bold;
text-shadow: white 0px 1px;
/* firefox */
background: -moz-linear-gradient(top, #eaeaea, #f0f0f0 100%);
-moz-border-radius: 5px;
/* webkit */
background: -webkit-gradient(linear, 0 0, 0 100%, from(#eaeaea), to(#f0f0f0));
-webkit-border-radius: 5px;
position: relative;
}
.loginSubmit:before {
width: 98px;
height: 98px;
content '';
position: absolute;
border: 1px solid black;
}
You forgot a colon in the .loginSubmit:before statement, which will make the rule invalid. So it won't render.
Make it like this:
.loginSubmit:before {
width: 98px;
height: 98px;
content: ''; /* <-- extra colon here */
position: absolute;
border: 1px solid black;
}
This example is working in firefox:
http://jsfiddle.net/bxTv7/
Update:
Check this question: Can I use the :after pseudo-element on an input field?

Resources