www.webdeveloper.com
Results 1 to 3 of 3

Thread: How do i get both these values to print on the same line?

  1. #1
    Join Date
    Dec 2008
    Posts
    76

    How do i get both these values to print on the same line?

    Hi,
    Here is my html code

    HTML Code:
    <div class="contentspan">test</div><div class="contentspanp">1200</div>"
    and here is my CSS definitions

    HTML Code:
    .contentspan{
    	padding:0px 0px 0px 0px;
    	margin:0px;
    	font-size:10px;
    	color:#666666;
    	font-weight:normal;
    	line-height:24px;
    }
    
    .contentspanp{
    	font-size:10px;
    	color:#666666;
    	font-weight:normal;
    	line-height:24px;
    	float:right
    	
    }
    but for some reason, the 1000 is coming out on the line below, is there a way to fix this to get both items on the one line ?

  2. #2
    Join Date
    Dec 2005
    Posts
    2,984
    I may be wrong in assuming this, but something tells me if you want these two divs to line up side by side and you only have the small amounts of text in them that you have shown above, then you actually want to use spans instead of divs.

    Now if you actually need to use the block level div elements then just float both elements to the left
    I've switched careers...
    I'm NO LONGER a scientist,
    but now a web developer...
    awesome.

  3. #3
    Join Date
    Dec 2008
    Posts
    76
    cool, i changed them to spans and it worked...

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
  •  
HTML5 Development Center



Recent Articles