New OOTS products from CafePress
New OOTS t-shirts, ornaments, mugs, bags, and more
Results 1 to 10 of 10
  1. - Top - End - #1
    Barbarian in the Playground
     
    HeadlessMermaid's Avatar

    Join Date
    Nov 2010
    Location
    This vicious cabaret
    Gender
    Female

    Default HTML question about font size

    High! I'm trying to produce this effect:

    Section Z [back to top]
    The only way I know to change font size is to define the entire paragraph. For example:

    <p style=font-size:10px>text here</p>
    But I don't want the smaller font to be on another paragraph, I'd like it to be on the same line with the regular-sized text. Is that possible?

    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

  2. - Top - End - #2
    Surgebinder in the Playground Moderator
     
    Douglas's Avatar

    Join Date
    Aug 2005
    Location
    Mountain View, CA
    Gender
    Male

    Default 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:
    Spoiler
    Show
    Saberhagen'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)

  3. - Top - End - #3
    Barbarian in the Playground
     
    HeadlessMermaid's Avatar

    Join Date
    Nov 2010
    Location
    This vicious cabaret
    Gender
    Female

    Default Re: HTML question about font size

    Quote Originally Posted by Douglas View Post
    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.
    Span worked, yay! :)

    I tried to use headers like this:

    <h3>TEXT</h3> <h6>small text</h6>
    but then it doesn't all end up in the same line, the small text goes on the line below.

    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

  4. - Top - End - #4
    Titan in the Playground
     
    CarpeGuitarrem's Avatar

    Join Date
    Jun 2008

    Default 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.
    Ludicrus Gaming: on games and story
    Quote Originally Posted by Saph
    Unless everyone's been lying to me and the next bunch of episodes are The Great Divide II, The Great Divide III, Return to the Great Divide, and Bride of the Great Divide, in which case I hate you all and I'm never touching Avatar again.

  5. - Top - End - #5
    Titan in the Playground
     
    ElfRangerGuy

    Join Date
    Aug 2007
    Location
    Imagination Land
    Gender
    Male

    Default 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.
    "Nothing you can't spell will ever work." - Will Rogers

    Watch me draw and swear at video games.

  6. - Top - End - #6
    Barbarian in the Playground
     
    HeadlessMermaid's Avatar

    Join Date
    Nov 2010
    Location
    This vicious cabaret
    Gender
    Female

    Default 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

  7. - Top - End - #7
    Titan in the Playground
     
    CarpeGuitarrem's Avatar

    Join Date
    Jun 2008

    Default 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
    Ludicrus Gaming: on games and story
    Quote Originally Posted by Saph
    Unless everyone's been lying to me and the next bunch of episodes are The Great Divide II, The Great Divide III, Return to the Great Divide, and Bride of the Great Divide, in which case I hate you all and I'm never touching Avatar again.

  8. - Top - End - #8
    Titan in the Playground
    Join Date
    Mar 2009
    Location
    Sweden
    Gender
    Male

    Default 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
    Show

  9. - Top - End - #9
    Titan in the Playground
     
    CarpeGuitarrem's Avatar

    Join Date
    Jun 2008

    Default 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).
    Ludicrus Gaming: on games and story
    Quote Originally Posted by Saph
    Unless everyone's been lying to me and the next bunch of episodes are The Great Divide II, The Great Divide III, Return to the Great Divide, and Bride of the Great Divide, in which case I hate you all and I'm never touching Avatar again.

  10. - Top - End - #10
    Titan in the Playground
     
    ElfRangerGuy

    Join Date
    Aug 2007
    Location
    Imagination Land
    Gender
    Male

    Default Re: HTML question about font size

    Quote Originally Posted by HeadlessMermaid View Post
    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.
    Quote Originally Posted by CarpeGuitarrem View Post
    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
    Additionally, you can link more than one CSS file to your web pages, so you can still set up site-wide classes and ids.
    "Nothing you can't spell will ever work." - Will Rogers

    Watch me draw and swear at video games.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •