Horizontal Menu Issues - html

I am having trouble getting a horizontal menu to line up correctly in IE9 and Firefox.
This is what it displays like in IE and Firefox:
And this is what it displays like in Chrome, Safari and Opera:
I keep getting that damn overflow!
What might be the issue?
My CS:
.service-list {
position:absolute;
top:0;
left:0;
display:block;
width:960px;
}
#services-content .service-list li {
float:left;
display:inline;
}
#services-content .service-list li a {
display:block;
float:left;
color:#F37FA8;
text-decoration:none;
padding:0 20px;
background-color:pink;
font-weight:400;
}
#services-content .service-list li a:hover {
text-decoration:underline;
}
#services-content .service-list li.last a {
padding-left:20px;
padding-right:0;
}
#services-content .service-list li.first a {
padding-left:0 !important;
}
The menu is spat out by wordpress.
Thanks,
Nick

Looking at the css on the site you posted. The inconsistency may be caused by your use of font-size:120% on the a tags (line 186 of style.css).
When you pop open firebug in firefox or developer tools in chrome, notice in the 'computed style' section that chrome is rendering 120% as 17px while firefox is rendering it as 16.8px.
How the browsers render this differently is a little out of scope, but you may want to try using pixels or ems instead. Hope this helps.

The issue is that there is a 40 pixel space between each item, and every item is being floated left, and this is making everything wrap when there's not enough room in each line.
You could try changing padding: 0 20px; in #services-content .service-list li a to something smaller, say padding: 0 10px;

Related

Styles for 'after' differ in browsers

I'm displaying a star after input box using :after. The styles are being rendered differently by different browsers. How can i make this appear similar in all the browsers. Please see this Fiddle in different browsers where in you can see the difference.
You can set width and height for a:after and give custom style to input (to avoid differences in padding, border, etc)
http://jsfiddle.net/omLc9nfe/7/
.a:after{
content:'*';
display:inline-block;
position:absolute;
top:-8px;
right:-8px;
width:8px;
height:8px;
text-align:center;
}
.a{
position: relative;
display:inline-block;
}
input {
border:1px solid #ccc;
margin:0;
padding:2px;
}
i've checked with safari, firefox and chrome.

Safari only - menu appears in the wrong place

Here is a link to my website.
In Chrome, Opera, Firefox and even the dreaded IE it displays fine, the way I want it to. In Safari, however, the menu appears 11px lower than where it should. I have honestly no idea what I have done wrong, how would I fix this?
Remove display:inline-block; (Safari: line 707)
Try This:
.main-navigation li a {
text-align: left;
color: #C9C9C9;
}
Instead of:
.main-navigation li a {
text-align: left;
display:inline-block;
color: #C9C9C9;
}

Text scaling in header

I'm making a site and I'd like it to scale properly on all devices.
On my 1080x1920 screen, it works perfectly, but on thinner devices the page does not look very good.
The white space is where the header text should be.
My code can be found here:
.header {
height: 80px;
background-color:#00117D;
background-size:100%;
color:#FFF;
font-size:30px;
font-weight:bold;
line-height: 80px;
padding: 0 30px;
border-bottom-style:solid;
border-width: 2px;
border-color:#FFF;
font-family:"Segoe UI";
}
.header p, .header a {
float: left;
margin: 0;
margin-left:30px;
color:#FFF;
text-decoration:none;
}
https://github.com/MooneyDev/project-Mooney
What I have done in previous projects it used em font size values on all properties but the body, and then used media queries at various stages to change the px based body value as required. This should catch all other values and keep them proportionate.
I would suggest you look into using bootstrap as it should really speed things up and take away a lot of the pain involved in responsive dev.

Why does this CSS cause extremely high memory usage?

I have an e-learning site that is causing Safari on iOS6 to freeze up and eventually shutdown. Turns out memory usage is increasing to the point where Safari cant handle it and just shuts down. I've slowly removed and added code until I isolated the issue to this set of CSS:
body{
margin:0; padding:0; font-family:'Roboto',Arial, Helvetica, sans-serif; font-size:14px; font-weight:300;
background:url(../images/bg-repeat.png) repeat-x bottom left;
}
*{outline:none;}
a { text-decoration:none; color:inherit;}
h1,h2,h3,h4,h5,h6{ font-weight:300;}
ul, ul li{ padding:0;}
#wrapper { position:relative; display:block; color:#3b3b3b; }
#contents-holder{ }
#content-area{ vertical-align:middle; color:#193048; margin-left:2%;}
#content-area h1 { font-weight:300; font-size:63px; border-bottom:2px solid #193048; padding:0; margin-bottom:10px; }
Can anyone guide me as to why this set of CSS is causing memory usage to increment until the point where the browser shuts down?
EDIT: In case its relevant, I am using JWPlayer 6.6 on this page. However, it doesnt seem that is the cause of the leak so far since commenting out the above CSS results in stable memory usage.

round corners no javascript or css3

I have a nav menu in which the hover state of a link looks like this,
As you can see there is a rounded corner background set upon an orange background. The client has requested that this works right through the IE6 (they are not at the stage where they can upgrade yet). Now I came into web-development quite recently so I have not learnt old techniques for achieving this effect could some enlighten me please? Below is my code, currently I am using CSS3.
#navPrimary {
background:#de4702;
height:37px;
margin:0px auto;
width:517px;
padding:5px 0px 0px 0px;
display:block;
overflow:hidden;
}
#navPrimary li {
width:252px;
float:left;
display:block;
height:100px;
list-style-type:none;
text-align:center;
margin:0px 0px 0px 8px;
}
#navPrimary li.first {
width:67px;
padding:0px 14px 0px 14px;
display:block;
margin:0;
}
#navPrimary .last {
width:154px;
}
#navPrimary li a {
color:#fff;
font-weight:bold;
text-decoration:none;
display:block;
height:27px;
padding:10px 0px 0px 0px;
}
#navPrimary li a:hover {
color:#de4702;
background:#fff;
-moz-border-radius:10px 10px 0px 0px;
-webkit-border-radius:10px 10px 0px 0px;
border-radius:10px 10px 0px 0px;
}
<ul id="navPrimary">
<li class="first">Home</li>
<li>Free Admission </li>
<li class="last">Terms & Conditions</li>
</ul>
The technique to achive this is called Sliding Doors. Read more about it here.
It's basically about using images at two elements (two parts of a door).. one at the left side and another at the right side.
It will take a few spans and images but you can get the same affect using the css sliding door technique. Check out this list apart article here: http://www.alistapart.com/articles/slidingdoors/
You also could try this css3pie which ads css3 tag support for IE6 to IE8
This may not work for you, but if you're needing rounded corners and all four corners are the same radius, you can make it work with CSS3 PIE:
http://css3pie.com/
Again, this only works if all your corners are the same radius.
If the only reason you have dismissed JavaScript as an option is because you don't think a JavaScript framework would support IE6, then have you checked out RaphaelJS (http://raphaeljs.com/)?
RaphaelJS is a graphics library which supports all major browsers including IE6.
You could also look at another pure CSS solution for rounded corners that does not require images or JavaScript.
http://www.spiffycorners.com/