Forum Moderators: open
I fully agree that CSS is superior to standard HTML in every way for the CODER. But it seems like between a site written in HTML and a site written in CSS, the HTML site is going to give the USER a better experience overall.
Are you talking about the standards from back in 1995?
HTML and CSS are partners, not alternatives to each other. HTML is a markup language not a style format. The font tag has been deprecated for years and excluded fully for the last 2-3yrs.
You might want to do some reading at the w3c, seems your concept of site building is slightly antiquated?
Nick
Moving the CSS to a style block in the <head> is an improvement, but the real gain comes in moving it to an external stylesheet file.
You then get to share the same stylesheet with every page of the site (easy updates), save bandwidth (serve CSS once per visitor not once per page view), etc.
Tring to create a webpage design while avoiding CSS is like tring to build a house while avoiding using a ruler.
I can't believe I didn't try it before I posted this thread but <h1><font size="2">Hello</font></h1> works in IE 6 to control the heading's size. Does anyone know if that works across browsers?
Yes it should "work" across browsers, but you still may be surprised at what users will actually see. This will depend on what default font they have set, and of course what fonts are available in their OS.
Also, you are sitting on the spam fence and better hope that a human never checks out your code and reports you to Google for spam techniques.
I will also invite you to use CSS for text formatting where font family, size, margin, all can be controlled. This will give you a heading a bit smaller. Adjust the number '22' to taste:
h1 {
background:transparent;
font:bold 22px times new roman,times roman,serif;
text-align:center;
margin:0;
}
keyplyr - You've got to be kidding me. You mean font tags inside h tags to control the outputted text's size is considered spam, but using CSS to accomplish the exact same thing isn't?
It's more a matter of how blatant you are about doing so.
<h1><font size="2">Hello</font></h1>
This is a manipulation of the H1 tag. It's done all the time, but usually not so tiny a text size as "2". This 'could' be construed as spam, especially if a competitor files a spam report and a Google editor takes a look at it in your mark-up. Hiding this manipulation in an external stylesheet, is far less conspiclative, although I would advise keeping the size relative to the standard.
The sky is not falling because of this technique. Go ahead and use CSS with impunity for this purpose.
<h1 style="font-weight: 500; font-size: 14pt; line-height: 120%; margin: 0,0,0,0">Hello</h1>
granted it may "bloat the code", but it pretty much works across the board in IE, Mozilla and Opera and it will actually render the page the way you really wanted it to look. just DON'T use the touted style="font: 500 14pt/100%" shorthand --spell everything out. it'll work in IE, but it breaks in Opera and Mozilla most of the time.