+ Reply to Thread
Results 1 to 8 of 8

Thread: CSS and the <p> tag

  1. #1
    Newbie Xenos is on a distinguished road
    Join Date
    Jan 2004
    Location
    Ohio
    Posts
    4

    CSS and the <p> tag

    I ran into a problem the other day. I wanted to make some text appear right below some other text. Of course I could use a <br>, but the style of the two texts we're different, and it was dependent on the <p> tag. How can I make it so that the two lines don't have a gap in between them but still have different styles? Is there a special attribute that I can use in the <p> tag to prevent that?

  2. #2
    Active Member WorldBuilder is on a distinguished road
    Join Date
    Jan 2004
    Location
    Boston, MA
    Posts
    366
    I find myself wondering exactly what you mean. Do you have a site that we could look at for you, and the code? Post that, and I'll have a look-see!

    Chris
    My Site | My Blog
    "The world is a dangerous place, not because of those who do evil, but because of those who look on and do nothing."
    "Insanity is doing the same thing over and over again, expecting different results"
    --Albert Einstein

  3. #3
    Full Member RedefinedMedia is on a distinguished road
    Join Date
    Jan 2004
    Location
    Kansas City
    Posts
    10
    Code:
    <style>
    p {
        margin : 0px;
    }
    </style>
    Ben Summers
    Head Programmer
    RedefinedMedia.com

  4. #4
    Full Member Bobert is on a distinguished road
    Join Date
    Mar 2004
    Location
    Huntsville, AL.
    Posts
    8
    This may be irrelavent to the person that started this thread by now, but I'll answer their question since it might help someone else.

    Instead of using a block level element like the <div> or <p> tags, just use an inline one, like the <span> tag.

    Another way to solve your problem would be to use a block level element and just change the way that it behaves, like this:

    Code:
    <div style="display: inline;">Stuff</div>
    You could use this method in reverse to change inline elements into block level elements as well for some nice effects.

    For example:

    You could change the anchors in a menu to block level elements to better control their padding, borders, positions, and such like this:

    Code:
    a.menuItems {
    display: block;
    }

    Hope this helps someone.

  5. #5
    Full Member NxorN is on a distinguished road
    Join Date
    Jun 2004
    Location
    USA
    Posts
    8
    Either use span/div or
    Code:
    p { line-height: Q px }
    may work (Q = Number < text size)
    N xor N

  6. #6
    Active Member the illest is on a distinguished road
    Join Date
    Jun 2004
    Posts
    152
    You could also use,

    Code:
    <span style="whatever">Text here</span><br />
    <span style="whatever number 2">Second line of text here</span>

  7. #7
    Active Member WorldBuilder is on a distinguished road
    Join Date
    Jan 2004
    Location
    Boston, MA
    Posts
    366
    Something tells me Xenos is gone, guys...

    Chris
    My Site | My Blog
    "The world is a dangerous place, not because of those who do evil, but because of those who look on and do nothing."
    "Insanity is doing the same thing over and over again, expecting different results"
    --Albert Einstein

  8. #8
    Newbie jamesdenish is on a distinguished road
    Join Date
    Jan 2011
    Posts
    2
    Browsers add to make room for the bullets to appear. If you remove the page margins, there is no place for that to happen. Since IE / FF to use another way to make room, it seems logical that if you zero in on one of them, the browser will not display bullets. I bet a version of IE would.
    Last edited by jamesdenish; January 10th, 2011 at 08:59 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

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