Results 1 to 3 of 3

Thread: Put label and content in different container without line breaking them

  1. #1
    Join Date
    Nov 2010
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Put label and content in different container without line breaking them

    I have label or heading beside each information, and I want to bold them to make them stand out, but so far I have only success in line breaking them before they will work. How do I bold or put the label and the information in two different containers without them line breaking?

    Code:
    			echo "<div class=\"eventHeading\">";					
    			echo "Time";
    			echo "<div class=\"eventInfo\">";	
    			echo "$eventTime";
    			echo "</div>";
    			echo "</div>";
    It is suppose to appear like this

    TIME:$eventTime

  2. #2
    Join Date
    Nov 2006
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    1,920
    Thanks
    2
    Thanked 267 Times in 262 Posts

    Default

    Hi there Wdblazer,

    If you use...
    Code:
    
        echo "<div class=\"eventHeading\">";					
        echo "Time";
        echo "</div>";
        echo "<div class=\"eventInfo\">";	
        echo "$eventTime";
        echo "</div>";
    
    ...instead, then your page would look something like this...
    Code:
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
       "http://www.w3.org/TR/html4/strict.dtd">
    <html lang="en">
    <head>
    
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <meta name="language" content="english"> 
    <meta http-equiv="Content-Style-Type" content="text/css">
    
    <title>time and event time</title>
    
    <style type="text/css">
    .eventHeading {
        float:left;
        padding-right:5px;
        font-weight:bold;
        text-transform:uppercase;
     }
    .eventInfo {
        float:left;
     }
    </style>
    
    </head>
    <body>
    
    <div class="eventHeading">time:</div>
    <div class="eventInfo">$eventTime</div>
    
    </body>
    </html>
    
    coothead

  3. #3
    Join Date
    Nov 2010
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I tried, but the result would look like this with a link break.

    Time:
    $eventTime

    Edit: Problem solved, I use span class for the $eventTime instead of div class, so they are still on the same line.
    Last edited by Wdblazer; 01-05-2011 at 06:38 AM.

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
  •