Concerns CSS, HTML and font...

YesYouMay

Junior Member
1. Is this code correct?

<p style="text-align: center; font-family: Times; font-size: 3em;">Big Mall Moon</p>

2. I want the text to be blue, how do I do that for the code above? Thank you.
 
well the css should really be in a css file called at the head of the html not in the P style (i'm sure Harry will agree).

though if you must include the style this way then it should be color: blue or preferably the hex colour. :)

hope that helps :D
 
Again, Chris covered it all, but if you aren't too preficient the addition would go as such:

<p style="text-align: center; font-family: Times; font-size: 3em; color:blue; ">Big Mall Moon</p>
 
Or shorthand like this. :p

<p style="text-align: center; font:3em Times New Roman, Serif; color:blue;">Big Mall Moon</p>
 
Where would I add the color for this?:

<p> <center><font size="3" face="Verdana"> big mall moon</font></center></p>
 
YesYouMay said:
Where would I add the color for this?:

<p> <center><font size="3" face="Verdana"> big mall moon</font></center></p>

The font tag is deprecated so don't use that code.

If you insist on using inline CSS then just write it like it like this.

<p style="text-align: center; font:3em Verdana, Arial, Sans-serif; color:blue;">Big Mall Moon</p>

But to be honest, instead of fiddling with that, just do it properly instead and create an external stylesheet. If you don't know how to add a color to some text, chances are you're not very confident with HTML/CSS. So maybe have a look at some tutorials and guides for basic CSS/XHTML? Would just be faster for you than asking here everytime you get stuck. ;)
 
Hi YesYouMay,

You need to keep your style separate from the html and then call the css file from your html page.

You can then add a style for paragraph like so

p {
font-family:Arial, Helvetica, sans-serif;
font-size: 11px;
font-style:italic;
line-height: 1.2em;
color:#055B8F; /*This is a comment for instructions, this is your blue colour */
}
 
Or just shorthand like this. (Sorry for being pedantic, just tell me to feck off :D)
p {
font: italic 11px/1.2em Arial, Helvetica, Sans-serif;
color:#055B8F;
}
 
Yes, size fonts in ems, it scales in IE6 that way.
And if they find small text hard to read and set their browser to an increased font percentage as a result. Setting it in pixels or points will make it impossible for people with bad eyesight to read your text tbh. :)
 
YesYouMay said:
1. Is this code correct?

<p style="text-align: center; font-family: Times; font-size: 3em;">Big Mall Moon</p>

2. I want the text to be blue, how do I do that for the code above? Thank you.

Hi there,

I'd say the same as everyone else - external sheet, use the code/s these folks provided, and try use hexadecimal color reference) also I'de recommend w3c schools / the CSS section (CSS Tutorial) it has loads of info dude, I wouldnt know jack if it wasnt for w3c schools! Not that I know a whole lot now...
 
Back
Top