Click to See Complete Forum and Search --> : CSS style attribute tags


LBLM
06-14-2008, 01:08 PM
I'm a newbie. I'm having some confusion concerning the layout of style within <p.......</p>. Is there a sequence for this ? Because if I set a font for 150% and a color red the page translates fine;BUT, if i put a centering command everything goes awry ?
e.g.,
If I put in < p style= "font-size: 150%;color:red;"......
and within that- <strong style="color:blue;".... the document comes out right with the appropriate font size and color changes;BUT, if i put a text centering command then the red font color turns to Black( the blue remains and, the < p style= "font-size: 150%;color:red;" prints on the browser page BEFORE the Text Proper that I WANT there ?
I'm confused with the layout(sequencing ?) of these style commands. THANKS.

Centauri
06-14-2008, 08:51 PM
What "text centering command" are you talking about? - centering text is visual style, and the correct method is with the text-align style property :
< p style= "font-size: 150%; color:red; text-align: center;">......</p>

LBLM
06-15-2008, 07:26 AM
What "text centering command" are you talking about? -

Thanks for the reply.
I'm talking about this one from the HTML Primer on this website:

<p style="text-align: center;">
All text in here will be centered
</p>

centering text is visual style,

I don't know what you mean by:"visual style". Sorry, I AM a Newbie.


and the correct method is with the text-align style property :
Code:
< p style= "font-size: 150%; color:red; text-align: center;">......</p

I'll try this. Thanks.

A question about how you set-up these style attributes:

Is the propper method to "String them in a series" as your doing here-
"property: value;" just strung together( no matter how many that might be)
OR do you "stack them up"-e.g., <p style="font-size: 150%;color: red;">
<p style= "text- align:center;"> etc..

The Primer confused me a little. Thanks.

Centauri
06-15-2008, 08:04 AM
I think you may be getting confused between html tags and style. <p> denotes a paragraph of text and is closed off with a </p> and cannot contain another nested <p></p>. Style properties are separated with semicolons and listed one after the other within the one style block. In the case of inline styles such as you have above, all the style properties you want to set are just strung together on the one line as in my previous example. If the paragraph style is included within <style> tags within the <head> section of the page, it is quite common to list these on separate lines for readability, but it really means the same :<style type="text/css">
p {
font-size: 150%;
color:red;
text-align: center;
}
</style>which will then affect ALL paragraphs on the page.

LBLM
06-15-2008, 08:31 AM
I tried the string you suggested,but it didn't work.For some reason the
<p style =.....</P> command PRINTS and shows before the text ?
This is the script I wrote (in a MAC)using "TextEdit" saved in Plain Text:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
ΚΚΚΚΚΚΚΚ"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title> Let's see if this works THIS TIME ! </title>
</head>
<body>
< p style= "font-size: 150%; color: red; text-align: center;" >
I <strong> HOPE </strong> this works, <strong style= "font-size: 175 %;" >
<br>
THIS TIME </strong> </p>
<p> Because if it doesn't that <strong style= "color: green;" > SUCKS ! </strong> </p>
</body>
</html>


BUT, THIS command DOES work:

<p> Because if it doesn't that <strong style= "color: green;" > SUCKS ! </strong> </p>

LBLM
06-15-2008, 08:35 AM
If the paragraph style is included within <style> tags within the <head> section of the page

I thought the Head section was the Title and the Body section was the Paragraphs of text ?

Centauri
06-15-2008, 08:42 AM
You have a space between the < and the p - there should be no space :<p style= "font-size: 150%; color: red; text-align: center;">

LBLM
06-15-2008, 08:50 AM
You have a space between the < and the p - there should be no space

I'll correct it. Thanks.

LBLM
06-15-2008, 09:12 AM
Thanks Centauri,that WAS the problem.Everything came out correctly.
EXCEPT the second <p> was placed at the default-left BECAUSE,( you make mistakes you learn)I NOW realize every NEW paragraph needs it's own specific commands. I had to put a centering attribute and another color command in place for the second paragraph.Which I didn't do.

Do you know of a good tutorial on the Web ?( The Primer here is fine, but
there are some "holes" in it;due to the very nature of it being a quick concept overview).
Thanks for the help.

WebJoel
06-15-2008, 09:52 PM
....<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
ΚΚΚΚΚΚΚΚ"http://www.w3.org/TR/html4/strict.dtd">
<html>.... -I am just curious, -what is this this?

LBLM
06-16-2008, 02:11 PM
Originally Posted by LBLM
....<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
ΚΚΚΚΚΚΚΚ"http://www.w3.org/TR/html4/strict.dtd">
<html>....

-I am just curious, -what is this this?


This as you know is a DOCTYPE TAG. Now, I THINK I know what you're getting at:

What are all these: EEEEEE in the command. My answer us I DON'T KNOW.
The MAC OS (or TextEdit) seems to be putting this in the Doctype command. I DON'T know why ? It seems to happen during a save operation. They don't seem to be affecting anything.
BUT, I'm assuming; maybe that's not what you mean ?

WebJoel
06-16-2008, 03:24 PM
It really is unnecessary to copy/paste the entire quote of every preceeding post :), the 'thread' has continuity of it's own and reading follow-up posts tells the story, and yes, I am intimately familiar with "!doctype" and am one of it's biggest proponants for using one. It is the "ÊÊÊÊÊÊÊÊ" that isn't making any sence. As for it 'not doing anything bad' to the document... I'd not be so sure. Take a slash or dot out of the !doctype, insert a 'whitespace' in a URL or misspell a word in the URL and you have rendered the !doctype ineffective and while the page will still display, in IE it would display in "quirks mode" instead of the intended version. Quirks mode is IE taking 'best guesses' at what to do, and it is renowned for guessing poorly...
That is the whole purpose of !doctype.

-I'd try to figure out what "ÊÊÊÊÊÊÊÊ" is and get it out of the document, as it isn't valid with it there. :)

LBLM
06-16-2008, 08:35 PM
I'd try to figure out what "ΚΚΚΚΚΚΚΚ" is and get it out of the document, as it isn't valid with it there

I'll try to pinpoint when it happens.I don't know WHY that EEEEEE is being put in there. It looks like their a place holder of some kind.The second line of the Doctype is indented and these E's are put in there to fill in the "vacancies" ?

Sorry about the quoting but that's the way I do it. I don't mean to annoy anyone.In fact, I do it for just the opposite effect.Just so the person doesn't have to read above to get the gist of what transpired before and can pick it up on the final post alone. Most people aren't as conscientious as you and don't bother to follow a conversational string.Didn't mean to offend.

When I work on the MAC ( which I haven't worked on in Years) it seems to be more of a convoluted procedure then on the PC.What I mean by that is in Wordpad or Notepad you just save in plain text. In TextEdit(Mac) there isn't the option to save initially in plain text .I have to go up top and select plain text from the VIEW menu THEN the script is in P.T. BUT,that throws all the formatting off and it has to be all re-set. I'm not sure if that's when those EEEEE's appear.
It's an old G4 Quicksilver on OS10.3.9.

LBLM
06-16-2008, 08:35 PM
I'd try to figure out what "ΚΚΚΚΚΚΚΚ" is and get it out of the document, as it isn't valid with it there

I'll try to pinpoint when it happens.I don't know WHY that EEEEEE is being put in there. It looks like their a place holder of some kind.The second line of the Doctype is indented and these E's are put in there to fill in the "vacancies" ?

Sorry about the quoting but that's the way I do it. I don't mean to annoy anyone.In fact, I do it for just the opposite effect.Just so the person doesn't have to read above to get the gist of what transpired before and can pick it up on the final post alone. Most people aren't as conscientious as you and don't bother to follow a conversational string.Didn't mean to offend.

When I work on the MAC ( which I haven't worked on in Years) it seems to be more of a convoluted procedure then on the PC.What I mean by that is in Wordpad or Notepad you just save in plain text. In TextEdit(Mac) there isn't the option to save initially in plain text .I have to go up top and select plain text from the VIEW menu THEN the script is in P.T. BUT,that throws all the formatting off and it has to be all re-set. I'm not sure if that's when those EEEEE's appear.
It's an old G4 Quicksilver on OS10.3.9.