Results 1 to 10 of 10
Thread: HTML question about font size
-
2014-11-09, 01:16 AM (ISO 8601)
- Join Date
- Nov 2010
- Location
- This vicious cabaret
- Gender
HTML question about font size
High! I'm trying to produce this effect:
Section Z [back to top]
<p style=font-size:10px>text here</p>
Thanks in advance. :)"We need the excuse of fiction to stage what we truly are." ~ Slavoj Žižek, The Pervert’s Guide to Cinema
"El bien más preciado es la libertad" ~ Valeriano Orobón Fernández, A las barricadas
"If civilization has an opposite, it is war." ~ Ursula K. Le Guin, The Left Hand of Darkness
Roguish | We Were Rogue | [3.5] Greek Mythology Variant | [3.5] The Fey Compendium
Avatar by Michael Dialynas
-
2014-11-09, 02:17 AM (ISO 8601)
- Join Date
- Aug 2005
- Location
- Mountain View, CA
- Gender
Re: HTML question about font size
It is possible in several different ways. The one closest to what you already know is simply use span instead of p. However, inline style attributes like that are considered very poor programming practice these days.
The good way involves a header tag (h1 through h6), possibly a class attribute, and a little CSS. That may or may not be worth it depending on the scale of what you're doing.Like 4X (aka Civilization-like) gaming? Know programming? Interested in game development? Take a look.
Avatar by Ceika.
Archives:
SpoilerSaberhagen's Twelve Swords, some homebrew artifacts for 3.5 (please comment)
Isstinen Tonche for ECL 74 playtesting.
Team Solars: Powergaming beyond your wildest imagining, without infinite loops or epic. Yes, the DM asked for it.
Arcane Swordsage: Making it actually work (homebrew)
-
2014-11-09, 03:09 AM (ISO 8601)
- Join Date
- Nov 2010
- Location
- This vicious cabaret
- Gender
Re: HTML question about font size
Span worked, yay! :)
I tried to use headers like this:
<h3>TEXT</h3> <h6>small text</h6>
I'm not sure I can mess with the CSS, it's a tumblr theme. Its CSS is not in the HTML itself, but gets called from somewhere else. The <h> attributes were defined by whoever made the theme, and I can only use them as is. I think.
In any case, the first suggestion worked, so thanks a lot!"We need the excuse of fiction to stage what we truly are." ~ Slavoj Žižek, The Pervert’s Guide to Cinema
"El bien más preciado es la libertad" ~ Valeriano Orobón Fernández, A las barricadas
"If civilization has an opposite, it is war." ~ Ursula K. Le Guin, The Left Hand of Darkness
Roguish | We Were Rogue | [3.5] Greek Mythology Variant | [3.5] The Fey Compendium
Avatar by Michael Dialynas
-
2014-11-10, 12:24 PM (ISO 8601)
- Join Date
- Jun 2008
Re: HTML question about font size
The <hX> tags push stuff out of the way by default so that they look like headers; ditto for <p> tags. (If you put a bunch of <p> tags together, they'd separate out into paragraphs accordingly.) I don't even know if it's possible to override that, and you don't want to; it's too useful otherwise.
Span is a pretty useful tool. Best when used in conjunction with a stylesheet, but inline style declaration works too. Of course, I would advise you just to put a style up at the top of the page, inside a <style> tag, instead of doing it inline, that way if you need to adjust it, you can do it easily.
Code:<head> <style> .small-text { font-size: 10px; } </style> </head> <p>So here's some text <span class="small-text">and here's some small text</span></p>
Last edited by CarpeGuitarrem; 2014-11-10 at 12:25 PM.
-
2014-11-20, 03:00 PM (ISO 8601)
- Join Date
- Aug 2007
- Location
- Imagination Land
- Gender
Re: HTML question about font size
@OP, considering this looks like something you'll have in several places on your page, I have to agree 100% with CarpeGuitarrem's suggestion of declaring a CSS class in the page header. It guarantees that your small texts will always be the same and lets you add changes to all of them at once. CSS is awesome like that.
-
2014-11-21, 03:56 AM (ISO 8601)
- Join Date
- Nov 2010
- Location
- This vicious cabaret
- Gender
Re: HTML question about font size
CSS appears indeed to be awesome (if a bit confusing for someone who doesn't technically know html...), but this isn't html from scratch. I'm modifying a tumblr theme which pulls a css from elsewhere, and I can't mess with it. (I've tried.) So I'm stuck with defining fonts and sizes and such on a case-by-case basis. It's OK, it wasn't a very big production, and it's done already.
Still, this is all very useful and interesting advice, and I'm sure it will come up in the future. So thanks again to everyone."We need the excuse of fiction to stage what we truly are." ~ Slavoj Žižek, The Pervert’s Guide to Cinema
"El bien más preciado es la libertad" ~ Valeriano Orobón Fernández, A las barricadas
"If civilization has an opposite, it is war." ~ Ursula K. Le Guin, The Left Hand of Darkness
Roguish | We Were Rogue | [3.5] Greek Mythology Variant | [3.5] The Fey Compendium
Avatar by Michael Dialynas
-
2014-11-22, 08:57 PM (ISO 8601)
- Join Date
- Jun 2008
Re: HTML question about font size
Unless it's using an @import for the CSS file, you should still be able to use CSS. Putting CSS in a <style> tag within the <head> tag will override any CSS file that's linked to the HTML page.
See here
-
2014-11-30, 08:46 AM (ISO 8601)
- Join Date
- Mar 2009
- Location
- Sweden
- Gender
Re: HTML question about font size
Let's apply a sanity check on the question:
Yes, it's possible!
And better yet, once we've done so, we can inspect the HTML and see that the forum uses the <font> tag with the size attribute to achieve this. The value doesn't have to be a lone number either, expressing it in px works just as well.
Of course, I'll leave it up to those who haven't learned HTML through disassembling web pages to evaluate whether this is good coding style or not. I've at least found that it isn't supported in HTML5, though...Clouddreamer Teddy by me, high above the world, far beyond its matters...
Spoiler: Banner by Vrythas
-
2014-12-02, 10:51 AM (ISO 8601)
- Join Date
- Jun 2008
Re: HTML question about font size
Yeah, the FONT tag is being deprecated, along with B and I (in favor of STRONG and EM, because I guess they want the single letters free to be used for other things). I think that's it, aside from DIV being a defacto new standard for a lot of things, like layout (which tends to be done via TABLE in older sites).
-
2014-12-17, 06:50 PM (ISO 8601)
- Join Date
- Aug 2007
- Location
- Imagination Land
- Gender
Re: HTML question about font size