Hm well I do have issues when viewing the site: there’s a list that is sitting over some text. So, something’s wrong.
Anyway, code:
<!doctype html public "-//w3c//dtd xhtml 1.0 strict//en"
"http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd">
I have no idea if browsers care about the capitalisation of the first part, but that’s how I’ve always seen it (with capital DOCTYPE). Once I miscopied a doctype where an extra space character came between the “public” and the “-//w3c” part and it threw IE into quirksmode (wow). To be safe I always copy from http://www.w3.org/QA/2002/04/valid-dtd-list.html
So far as I know, the HTML5 doctype is caps-agnostic, but the others, I tink they must be capitalised.
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>anna b - mobile hairdresser</title>
<meta http-equiv="content-type"
content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="style.css" />
<link rel="stylesheet" type="text/css" href="nav.css" />
Re-arrange this.
In the HTML element, where you have the xmlns attribute, add lang and xml:lang attributes like so:
<html xmlns=“http://www.w3.org/1999/xhtml” xml:lang=“en” lang=“en”>
This tells user agents the language of the page (not the site). A screen reader will know which language to use from this: otherwise, it will usually start out in whatever default language the user has set it to, not your page language.
<meta http-equiv=“content-type”
content=“text/html; charset=iso-8859-1” />
Put this first thing after the opening <head> tag. Browsers should start reparsing the page when they hit this, so make sure they redo as little as possible.
(more info: http://www.joelonsoftware.com/articles/Unicode.html)
<link rel=“stylesheet” type=“text/css” href=“style.css” />
<link rel=“stylesheet” type=“text/css” href=“nav.css” />
Each separate stylesheet is a separate request to your server.
The browser stops there, sends a request to your server… waits for 200 OK, starts loading the file, moves on to the second line and stops (it’s still loading the first file though as all the modern browsers I know of will at least do 2 requests at once… some do more), waits for 200 OK and starts loading the file. The browser may wait until the CSS files are fully loaded before moving on.
So when your site is “ready”, make those a single file so there’s only a single request.
<h1>
<img src="images/words.gif" alt="anna b mobile hairdresser logo - multicoloured anna b with mobile hairdressing word cut in half by a pair of scissors" />
</h1>
That amount of alt text is pushing it. They recommend no more than 100 characters.
Also, alt text’s job isn’t to describe the image, but convey what would be lost if the image wasn’t there. In this case, it’s not just a logo but the name of the site. It’s mostly decorated text. So I’d state
“Anna B - Mobile Hairdresser”
in general, you don’t even bother saying it’s a logo. View your site with images off and you’ll see that just the name fits nicely.
If you didn’t have a logo, you’d have
<h1>anna b — mobile hairdresser</h1> right?
There’s also been a WebAIM survey where some screen reader users indicated that they’d rather just hear the name text in that instance and not “logo” link, scroll down to Logos (conversely people did want to know if a photo of something was a photo [url=http://webaim.org/projects/screenreadersurvey2/#images]link). Since you’re not repeating the name again later (as is sometimes done on sites with logos), I’d go as if I didn’t have a logo at all.
Similarly here:
<img src="images/pinkcard.gif" alt="icon stating live in sheffield s35/s6? call 08713021046 to book" />
alt=“Live at Sheffield s35/s6? Call 0871 302 1046 to book”
I have no idea what that means though, so know that must be very region-specific or something.
<div class="clear"></div>
This is an old clearing technique. You definitely don’t need it here: there’s a div called class=“header pink” following that and so long as one of those two classes is always following the floated images, you could have that class do the clearing.
Ok I didn’t look but let’s say they are all “header”
.header {
clear: both;
rest of styles;
}
The separate clearing-div thing was created for situations where there normally wasn’t any content coming later but the authors wanted the floats enclosed in their containers. [url=http://stommepoes.nl/floaties.html]view float-clearing and enclosing methods in a modern browser and IE7 here
<div class="menu">
<ul>
Wrapping divs are common on web pages but know that if you don’t need one, don’t use it (no harm done, just worthless bloat). If I check your CSS styles I see that .menu isn’t doing anything the ul itself couldn’t do:
.header .menu {
width: 1000px; margin: 0 auto; position: relative;
}
.header .menu ul {
list-style-type: none;
}
So you could
<ul class=“menu”>
and then
.header .menu {
width: 1000px; margin: 0 auto; position: relative; list-style-type: none;
}
done.
Later I noticed this:
.header .menu li a {
margin: 17px 0 0 0; float: left; display: block; text-indent: -9999px;
}
First, floating stuff already puts it in block context, so “display: block” here is redundant.
More importantly, anyone surfing without images gets zero text, unless they are also surfing with some AT or with CSS off as well. The negative text indent must die.
If you only cared about Safari you could do all that text styling with CSS alone, but since you care about more browsers, you’ll need to use image replacement and use a better technique than the one you have.
list of popular image replacement techniques and their drawbacks
I rather like Gilder-Levin and use it the most, because I want that if images are off or don’t load for some reason, that there is still useful text for everyone.
This would mean moving your spans around from this:
<li><a href=“index.html” class =“current home”><span>home</span></a></li>
to this
<li><a href=“index.html” class =“current home”>home<span></span></a></li>
You’ve already got spans and you’ve already got separate classes to style each individually, and your image isn’t semi-transparent, so you’re missing all the drawbacks Gilder-Levin has.
You could consider using it for your logo and thingie on the right as well IF you wanted to be able to style the text underneath in all browsers… however those two spots have the disadvantage of text being able to leak out if it got bigger than the image (which could easily happen if a user enlarges text without zooming)… to me this is the real drawback of Gilder-Levin, but I still use it as needed and try to deal with the overflow issues as best I can.
Also, you’ve got :hover styles listed in your #footer… but why no :focus? Most of the time, wherever you state :hover you’ll want :focus too (for links and things). This gives someone keyboarding through the site the same visual feedback as someone going through with a mouse. And lots of devices don’t have mice.
<img src="images/crouching.gif" alt="a serene blue tinted picture of a young woman with blonde hair" class="topleft"/>
What is she saying about the topic? If I’m reading a web page about a hairdresser, this text just comes out of nowhere and distracts me and tells me nothing. Why is the woman there? She’s decoration in my opinion. That means she gets alt=“”, which is valid and ok to do (though because I consider her decoration, I’d also consider moving her to a CSS background instead of an image).
<div class=“list”>
<ul>
this is covering the h2 above it in my browser. Here’s why:
.list ul{
[b] position: absolute;[/b]
top: 110px;
right: 10px;
width: 650px;
font-family: "trebuchet ms", helvetica;
font-size: 105%;
}
Again, you can lose the wrapping div and move that class over to the ul itself. Ul’s are blocks like divs, they’re just limited in what they can have directly inside them. They can have all the styles any other blocks can have.
<div class="boxleft">
<img src="images/paying.jpg" alt="a gold credit card" class="topleft"/>
<div id ="righttextbottom">
<p> <span class="pinktext2" >price</span> </p>
</div> <!-- righttext -->
</div> <!-- boxleft -->
That looks like way too much code, but then, it also looks unfinished. Will there be a list of prices there? Or a link to a price page?
“boxleft” is a terrible name if you later decide to swap “price” with “testimonials”. Why not call the box “prices”?
<div class=“odd box prices”>
<p>price</p>
</div>
That’s actually all you really need. Let CSS do the rest of the work: let “box” class have what all boxes share: the pink border and widths and min-heights, and being floated (you can start with float: left and then override to float: right on .even boxes), .odd and .even setting float directions (and in this case, .odd will likely be clearing too), and .prices being specific to this box (setting credit card image as a background).
You can use a collection of padding, text-align or width-limiting and floating to set the p’s, or line-height to vertically center them OR reduce the height of .box divs and add top-padding to make it up.
Because the credit card image would be a background colour, padding on .prices div won’t “show” because background images are painted on the padding-box (all the area covered by the div not counting borders and margins).
Clearing div again… lose it. Here, it seems you can get these two boxes side by side simply by floating all .odd left and .even right (everything I said about the price box can apply to all the other boxes). They’ll sit evenly next to each other so long as .wrapper is wide enough to let them. .odds can clear: both.
Well, IE (6 and 7) does not like floats clearing floats, though if they are each floating in opposite directions it might work, not sure. Paul likely knows a way around that bug for this situation here.
“Area covered” is popping out of its box in my browser. This may be because I don’t have “leaguegothic” as a font, and you’ve listed no backups for me.
“Here we go…” doesn’t tell me anything… what’s that mean?
Your page doesn’t validate BUT that seems to be partially from your lower case doctype (again, though, I dunno if that’s really a problem or just the validator being a turd) and teh evil goOglez adding in unescaped ampersands in URLs (each & is in turn causing the following = to be called an error) and having <style> tags in the body.
It would prolly be better if the google code dynamically inserted the stylesheets into your <head> rather than requiring that they sit and invalidate your page all day.
I get a scrollbar if I’m under 1174px width… consider letting the page shrink from two cols to one so those without ginormous screens can read it without constant scrolling back and forth.
You can either do that by letting the “How can I get stylish hair…” box shrink in width (and let the text inside just wrap) and letting the floated boxes stack on top of each other (which they would do if .wrapper was too small, so let .wrapper have just a max-width to limit the boxes to 2 in a row)…
or you could try using CSS3 @media queries using min and max width. Those are fun but leave IE6 and 7 behind, so I like the first idea better but media queries are neat when playing with (modern) mobiles and tiny Desktop screens.