am i using css properly??? (Full Version)

All Forums >> [Web Development] >> Cascading Style Sheets



Message


labs123 -> am i using css properly??? (3/14/2005 7:36:42)

Hi
Im currently learning css. Instead of using bold I have defined a span style for bold as I need to use it in the middle of paragraphs.
span.bd 
{ font-size: 10px; font-weight: bold }


Is this the best way to do this??? [8|]

I also need to make paragraphs bold should I use the same span or define it as a paragraph style

Thanks




Donkey -> RE: am i using css properly??? (3/14/2005 8:08:54)

Rather than use a span I would define the <b> tag and use that (less typing).
For the same reason I would say it's better to have a paragraph style with bold defined than use nested <span> and <p> tags.




labs123 -> RE: am i using css properly??? (3/14/2005 9:21:06)

Thanks for the advice Donkey. Im a little new to this so did u mean like this

p.bold
{font-size: 10px;
 font-weight: bold
}


Can I just use the b in frontpage or did you mean define it like this in the style sheet
b
{font-weight: bold}







Donkey -> RE: am i using css properly??? (3/14/2005 9:46:09)

Yep. That's what I meant.

The bold tag has not been depreciated in xhtml so you can still use it, but there's nothing to stop you defining it or AFAIK creating classes for it. You can give the font-weight property numerical values as well as just bold, bolder and lighter. So in theory you could have several classes of bold tag giving varying levels of boldness. In practice I understand it is a bit hit & miss as some fonts will default to only one level of boldness. (or should that be boldidity?[;)])




labs123 -> RE: am i using css properly??? (3/14/2005 10:21:15)

quote:

Yep. That's what I meant.


Feels good to know Im actually getting all this

Cheers Donkey your the best [sm=boogie.gif]




Nicole -> RE: am i using css properly??? (3/14/2005 18:43:01)

Hi Labs,

It's probably a very basic tip, but we (I do) tend to get wrapped up in the actual CSS and page that i'm working on, and lose sight of the forest for the trees. An excellent example of this is the most recent questions i've asked on this board about some CSS problems.

It takes patience, but sometimes when you encounter a problem, try starting a new page, attaching a brand new CSS with only the code you're having trouble with and experiment with that code and see what happens to the new page.

I know it sounds very basic, but i've just done this, and solved a problem in a matter of 10 minutes that i'd laboured over for 2 days.

Stick with CSS btw, i'm very new to it also, and can't imagine creating a site without CSS again!

Nicole




d a v e -> RE: am i using css properly??? (3/15/2005 0:17:07)

unless you have some specific reason for doing so i would just leave it in the html, i.e. use
<strong>this text is bold</strong>


though of course there's nothing to stop you playing:)




jaybee -> RE: am i using css properly??? (3/15/2005 5:01:52)

Just shows how flexible all of this is.

If I have something that will be BOLD in lots of pages or several places on one page then I specify it in the style sheet.

If it's just one thing in one page then I'll sometimes stick a span on it.

If however it's a site that will be subject to changes later on then I use the style sheet as I may well need to use it more often in changes.




labs123 -> RE: am i using css properly??? (3/15/2005 5:04:43)

I have redone my whole work site using css for formatting,,, i think positioning is a little beyond me at the moment but will carry on playing and finding out new things [;)]

Thanks for the help darlings!!!!!




jaybee -> RE: am i using css properly??? (3/15/2005 5:07:02)

Positioning is the toughie.

I now have 3 basic layouts I keep as templates and tweak those for each new site. If you're going to use css for layout be prepared for it to take you quite a while if the layout is more than a 2 col with header.




labs123 -> RE: am i using css properly??? (3/15/2005 5:41:21)

quote:

Positioning is the toughie.


Yep I read up on it and thought hmmmm will save that until later.

Like you said Jaybee its all very flexible and depends on the site will see what fits the site better. Its 50+ pages now so I might define b in the style sheet incase the site needs more boldidty in the future [:D]





jaybee -> RE: am i using css properly??? (3/15/2005 7:13:47)

quote:

more boldidty


Oh please don't encourage him!




Donkey -> RE: am i using css properly??? (3/15/2005 9:28:32)

quote:

more boldidty
If I may correct your spelling on this one.
quote:

bol·did·i·ty
n. pl. bol·did·i·ties

1. The act of emboldenment.
2. Bravery in a silly or pointless way.
3. A little known 60’s rhythm and blues guitarist.

From the Oxford Imaginary Dictionary of made up words.[;)]




labs123 -> RE: am i using css properly??? (3/15/2005 10:15:32)

quote:

Oh please don't encourage him!


sorry Jaybee - Its too late!!!!




jaybee -> RE: am i using css properly??? (3/15/2005 13:32:44)

[&o]




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.125