Ive only just started looking at CSS so please beat with me.
How do I change the font size of text that is not within a paragraph?
This stylesheet example only changes text in parapgraph.
p{
font-size: xx-small;
font-family: Arial,sans-serif;
color: #000000;
}
This stylesheet doesnt change the font size
body{
font-size: xx-small;
font-family: Arial,sans-serif;
color: #000000;
}
So what do I need to change the font size of text not within a paragraph?
Ideally Im looking for a font size 2 equivilent.
Thanks in advance.
Are you a Google Analytics enthusiast?
Share and download Custom Google Analytics Reports, dashboards and advanced segments--for FREE!

www.CustomReportSharing.com
From the folks who brought you High Rankings!
More SEO Content
International SEM | Social Media | Search Friendly Design | SEO | Paid Search / PPC | Seminars | Forum Threads | Q&A | Copywriting | Keyword Research | Web Analytics / Conversions | Blogging | Dynamic Sites | Linking | SEO Services | Site Architecture | Search Engine Spam | Wrap-ups | Business Issues | HRA Questions | Online Courses
Css Font Size For Text Not In Paragraph
Started by
excel30
, Jun 15 2007 05:12 AM
5 replies to this topic
#1
Posted 15 June 2007 - 05:12 AM
#2
Posted 15 June 2007 - 02:26 PM
This may not be the best method, but I usually prefer to start my stylesheet with:
*, td
{
font-size: ##;
font-family: Verdana;
}
That way everything looks the way I want, and then I style other HTML elements, spans, divs, etc as needed.
Added:
*, td - td is added because some styles do not want to work on a td with just * used
*, td
{
font-size: ##;
font-family: Verdana;
}
That way everything looks the way I want, and then I style other HTML elements, spans, divs, etc as needed.
Added:
*, td - td is added because some styles do not want to work on a td with just * used
#3
Posted 17 June 2007 - 09:01 PM
"So what do I need to change the font size of text not within a paragraph?
Ideally Im looking for a font size 2 equivilent."
You could use "inline style" as such:
<span style="font-size: medium;">Johnny was a very good boy.</span>
or in your stylesheet, add another class:
.bigger { font-size: medium; }
<span class="bigger">Johnny was a very good boy.</span>
You could also change the body block and all text on the page that isn't set to some other font-size will be set to the body font-size.
body{
font-size: some-other-size;
font-family: Arial,sans-serif;
color: #000000;
}
I use px for font-size. It's more uniform across-the-board with different browsers. Consider using px instead of other formats.
Good Luck!
Ideally Im looking for a font size 2 equivilent."
You could use "inline style" as such:
<span style="font-size: medium;">Johnny was a very good boy.</span>
or in your stylesheet, add another class:
.bigger { font-size: medium; }
<span class="bigger">Johnny was a very good boy.</span>
You could also change the body block and all text on the page that isn't set to some other font-size will be set to the body font-size.
body{
font-size: some-other-size;
font-family: Arial,sans-serif;
color: #000000;
}
I use px for font-size. It's more uniform across-the-board with different browsers. Consider using px instead of other formats.
Good Luck!
Edited by maleman, 17 June 2007 - 09:12 PM.
#4
Posted 18 June 2007 - 06:38 AM
Try
[codebox]
body,p,td,div,h1,h2,h3,li,a {
font-size: some-size;
font-family: Arial,sans-serif;
color: #000000;
}
[/codebox]
A bit rude - but there you go.
BTW relative font size is OK - it keeps your pages accessible and expandable. However if your layout is rigid you may have to use absolute pixel values but dont make it a rule. Use it with reason. You can compensate for the difference in font size between platforms when using relative font size with a simple hack.
C.
[codebox]
body,p,td,div,h1,h2,h3,li,a {
font-size: some-size;
font-family: Arial,sans-serif;
color: #000000;
}
[/codebox]
A bit rude - but there you go.
BTW relative font size is OK - it keeps your pages accessible and expandable. However if your layout is rigid you may have to use absolute pixel values but dont make it a rule. Use it with reason. You can compensate for the difference in font size between platforms when using relative font size with a simple hack.
C.
#5
Posted 05 September 2007 - 06:17 PM
You could use "inline style" as such:
<span style="font-size: medium;">Johnny was a very good boy.</span>
<span style="font-size: medium;">Johnny was a very good boy.</span>
I have to respectfully disagree with this. Yes you could functionally do it like that, but creating inline styles negates the benefits of using CSS in the first place. If you need to change a style you don't want to have to hunt through all your pages to find those pesky inline styles.
or in your stylesheet, add another class:
.bigger { font-size: medium; }
<span class="bigger">Johnny was a very good boy.</span>
.bigger { font-size: medium; }
<span class="bigger">Johnny was a very good boy.</span>
This is a much better way to go and preserves all your flexibility to change your stylesheet in the future.
#6
Posted 06 September 2007 - 03:33 AM
CODE
*, td
{
font-size: ##;
font-family: Verdana;
}
p {
font-size: x.xem;
{
font-size: ##;
font-family: Verdana;
}
p {
font-size: x.xem;
I haven't tried it, but see how this goes.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users









