CSS is confusing

Nocturnal

Lifer
Jan 8, 2002
18,927
0
76
There's a grip of stuff you have to remember.

I have Q, why do you use something like

<p class=whatever>blah</p>

and then sometimes you just use:

<p>blah</p>

Like is this when you have more than one "p" in the <head> tags? Like p.whatever, p.bold, p.xxx etc?

Confusing to say the least.
 

gopunk

Lifer
Jul 7, 2001
29,239
2
0
you use the class to define how the text in the paragraph will look. you can redefine the p tag, which means you don't need to do the class stuff.
 

AgaBoogaBoo

Lifer
Feb 16, 2003
26,108
5
81
I'm kind of confused what you're asking, but it gets easier after some time. Once you do learn it, it can save a lot of time, especially when you use it correctly and link to the css in the header so you can modify the formatting on all the pages through one file.
 

dcdomain

Diamond Member
Jan 30, 2000
5,158
0
71
Dude yeah... it's confusing... especially to me, a graphics guy. But oh man so worth it. Why remember any tags at all? There's probably a dozen or so you'll remember just because they are used so much, but the internet is at your fingertips. I usually just reuse old style sheets and just change/delete the values.

Sometimes, for certain paragraphs, you want a specific style applied to it and sometimes you don't. So for like paragraph one, I want that sucker bolded, indented, and in italics, and in paragraph two I don't. So for paragraph one, I'm gonna have class="whatever" (with whatever being bold, indented and in italics) and for paragraph two, it won't have a style applied to it.

As for p.whatever, p.bold, p.xxx etc, I'm still a bit confused about them, was just reading a CSS book at the library today, but since I didn't apply anything I learned yet, it went right out the window. Like I'm not sure what the difference is between and ID which is I think something like #blah as opposed to a ... style I think which is .blah...
 

Nocturnal

Lifer
Jan 8, 2002
18,927
0
76
Yeah no doubt about saving time, that's for sure. I'm just confused with all the different types there are to it.
 

gopunk

Lifer
Jul 7, 2001
29,239
2
0
Originally posted by: dcdomain
Dude yeah... it's confusing... especially to me, a graphics guy. But oh man so worth it. Why remember any tags at all? There's probably a dozen or so you'll remember just because they are used so much, but the internet is at your fingertips. I usually just reuse old style sheets and just change/delete the values.

Sometimes, for certain paragraphs, you want a specific style applied to it and sometimes you don't. So for like paragraph one, I want that sucker bolded, indented, and in italics, and in paragraph two I don't. So for paragraph one, I'm gonna have class="whatever" (with whatever being bold, indented and in italics) and for paragraph two, it won't have a style applied to it.

As for p.whatever, p.bold, p.xxx etc, I'm still a bit confused about them, was just reading a CSS book at the library today, but since I didn't apply anything I learned yet, it went right out the window. Like I'm not sure what the difference is between and ID which is I think something like #blah as opposed to a ... style I think which is .blah...

when you say p.bold, you're redefining what happens when you use the <b> tags in a <p> block.

er now that i think about it, i think that's p.b

i think... gah it's been a while
 

dcdomain

Diamond Member
Jan 30, 2000
5,158
0
71
I heard for display data from a database, that we should still go with tables. Is this true?

As for whether or not to use tables or just pure css, I've been trying to convert everything over to CSS. There are some odd things that happen, but the code just looks so much cleaner using CSS.
 

Kev

Lifer
Dec 17, 2001
16,367
4
81
learning css is easier than learning how to make a peanut butter & jelly sandwich. you are retarded.