Miscellaneous > Programming & Networking

Smartarse html question

<< < (2/2)

xyle_one:
I found some info-
Introduction to CSS
http://www.w3.org/Style/CSS/

I like css, but i haven't spent much time to actually learn it. I know some things, but the more intricate formatting just flies right past me.

basically, you create a new file, call it style.css. You will also have your html file. In that file, you will want to add this tag under <head>

--- Code: ---
--- End code ---
A generic css doc looks like-

--- Code: ---
--- End code ---
or more simply-
--- Code: ---
--- End code ---

[ September 04, 2003: Message edited by: ecsyle:951 ]

jasonlane:
Yup that's it, it the long run it's all about reusability, which is a good thing....do more with less      ;)    

There are a two main basic types of selector in CSS


--- Code: ---
--- End code ---

for reusability you would use a class, as it can apply to many, referencing a style by id is if you just have one instance of that id.

you can also do some cool things like


--- Code: ---
--- End code ---

Ideally all structural mark up should be just that,  just content and structure, all styling wherever possible should be handled by css.

So if you want an image to have a 5px padding around it, but only if it is contained within a given tag by say id you could do something like:


--- Code: ---
--- End code ---

Note that most box elements can also be styled thus:


--- Code: ---
--- End code ---

Here's a site I'm working on at the moment, the styles are entirely driven by CSS and the css is here.

You're more than welcome to rip any CSS off       ;)    


The site's not finished yet so there are a few errors    :(  

As ecsyle has already pointed out:

http://www.w3.org/Style/CSS/

The only reference you should need,

[ September 04, 2003: Message edited by: Zardoz ]

xyle_one:
itm

Navigation

[0] Message Index

[*] Previous page

Go to full version