SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot buzza_gts's Avatar
    Join Date
    Oct 2005
    Location
    Melbourne
    Posts
    157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Placing <div> in Paragraph?

    Im working on a site that is going to have a section on poker hand rankings.

    Curently im having some problems geting a <div> to sit inside a paragraph.

    Here is my HTML:

    HTML Code:
    <p>Here is some text before the king of spades <div class="spade">K</div> and here is the text after the king of spades.</p>
    And the CSS:

    Code:
    .spade {
    	display: inline;	
    	font-weight: bold;
    	padding-right: 8px;
    	margin-right: 3px;
    	background-image: url(poker_spade.gif);	
    	background-repeat: no-repeat; 
    }
    In the browser the <div class="spade">K</div> sits on a new line?

    How can you get a div to sit inside a paragraph?

    Thanks.

  2. #2
    SitePoint Wizard bronze trophy Tyssen's Avatar
    Join Date
    Oct 2005
    Location
    Brisbane, QLD
    Posts
    4,067
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Use span instead of div.

  3. #3
    SitePoint Zealot buzza_gts's Avatar
    Join Date
    Oct 2005
    Location
    Melbourne
    Posts
    157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sweet, thanks mate.


Bookmarks

Posting Permissions

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