Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    Regular Coder Kevin_M_Schafer's Avatar
    Join Date
    Apr 2011
    Location
    Fairfax, Minnesota, U.S.A.
    Posts
    482
    Thanks
    97
    Thanked 17 Times in 17 Posts

    Increasing point size on just one word in CSS class

    When I build a CSS class and use it for several pieces of text on different parts of my page, is there a correct way to increase the point size on just one word?

    I know font tags are frowned upon, so I want to learn the right way.

    Any help would be greatly appreciated.

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,849
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    is there a correct way to increase the point size on just one word?
    Just set a different class on it and override the previous style using this.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • Users who have thanked abduraooft for this post:

    Kevin_M_Schafer (05-02-2011)

  • #3
    Regular Coder Kevin_M_Schafer's Avatar
    Join Date
    Apr 2011
    Location
    Fairfax, Minnesota, U.S.A.
    Posts
    482
    Thanks
    97
    Thanked 17 Times in 17 Posts
    abduraooft,

    Thanks for the reply.

    I built a new class for this point size and it will get used often.

    Question: Do I que this new class with a div tag or how do I call on it? A div tag wants to knock the following text to a second line.

  • #4
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,849
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Question: Do I que this new class with a div tag or how do I call on it? A div tag wants to knock the following text to a second line.
    There's something wrong with your understanding. <div> just one , in the list of all tags in html. Besides that, <div> is a block level element (like h1...h6, p, blockquote, ul, li etc.).

    To style a specific word or phrase inside a text, you may use a <span>. If the text to be styled has some extra significance in the document, you may use tags like <strong>, <em> etc.

    Can we have a link to your page or some of your markup?
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • Users who have thanked abduraooft for this post:

    Kevin_M_Schafer (05-02-2011)

  • #5
    Regular Coder Kevin_M_Schafer's Avatar
    Join Date
    Apr 2011
    Location
    Fairfax, Minnesota, U.S.A.
    Posts
    482
    Thanks
    97
    Thanked 17 Times in 17 Posts
    abduraooft,

    Thanks for your reply. I'm learning this as fast as I can.

    Here is my current site: http://www.theeagleextra.com There are 600 + errors and 100 + warnings.

    Here is what I'm building now to take its place: http://www.theeagleextra.com/sophie.html

    I know it's not correct, I'm atleast trying to do the right thing.

    Here's my situation: I'm learning this while I need to use it. Two weeks ago I had a do-it-myself website online hosting template.

    I've been in the printing business for over 30 years, and I know composition, I'm just trying to create on the screen what I would want on the sheet -- so to speak.

    I no sooner learned html and tables and now I have to throw all of that away and learn CSS. I'm getting it, and with this message board I'm learning it. Please help.

    I don't understand why a <p class="0000"></p> or a div tag knocks the following text onto a new line.

    Thanks for your time.

  • #6
    Senior Coder
    Join Date
    Apr 2011
    Location
    London, England
    Posts
    2,120
    Thanks
    15
    Thanked 354 Times in 353 Posts
    I don't understand why a <p class="0000"></p> or a div tag knocks the following text onto a new line.
    Class names cannot begin with a number, but can contain numbers, letters hyphens or underscores.

    Divs are block-level elements by default. That is, they occupy the full width of their parent element and may have paragraph spacing above and/or below them. This spacing can be controlled using css margins and/or padding. (Added: paragraphs p are also block-level elements.)

    Spans are inline elements by default. Prefer these for modifying or formatting inline text or other elements.

    These are general rules of thumb though, as divs and spans can be modified to behave as either block or inline elements.
    "I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
    Validate your HTML and CSS

  • Users who have thanked AndrewGSW for this post:

    Kevin_M_Schafer (05-02-2011)

  • #7
    Regular Coder Kevin_M_Schafer's Avatar
    Join Date
    Apr 2011
    Location
    Fairfax, Minnesota, U.S.A.
    Posts
    482
    Thanks
    97
    Thanked 17 Times in 17 Posts
    Hi Andy,

    A question: Okay, if this text is going along and I stop to do this <font-face="verdana">etc . . </font> this is wrong, but if I stop to do this <span font-color="blue">etc . . </span> this is alright?

    You said the other day to avoid font tags. I just want to make sure I understand.

    Do font tags slow the browser down -- or are they going to be completely phased out someday?

  • #8
    Senior Coder
    Join Date
    Apr 2011
    Location
    London, England
    Posts
    2,120
    Thanks
    15
    Thanked 354 Times in 353 Posts
    The font tag is being phased out and should not be used.

    Both of your samples are, unfortunately, invalid:

    Code:
    <span style="color:blue;">Something blue.</span>
    This uses an inline style, but you would be better served by creating a stylesheet to define the overall styling of your page/site.

    Perhaps this SitePoint article will point you in the right direction.

    Added: Or refer to the sticky which lists other resources.
    Last edited by AndrewGSW; 05-02-2011 at 08:23 PM.
    "I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
    Validate your HTML and CSS

  • Users who have thanked AndrewGSW for this post:

    Kevin_M_Schafer (05-02-2011)

  • #9
    Regular Coder Kevin_M_Schafer's Avatar
    Join Date
    Apr 2011
    Location
    Fairfax, Minnesota, U.S.A.
    Posts
    482
    Thanks
    97
    Thanked 17 Times in 17 Posts

    Thanks

    Thanks, Andy. I'm going to go ahead and develop classes and call them up using <span>.

    I hope this is correct.


  •  

    Posting Permissions

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