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 2 of 2
  1. #1
    New Coder
    Join Date
    Mar 2012
    Posts
    17
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Kerning with span class?

    I've got 4 lines of text in a class, I'm trying to indent the last couple of lines abit to so they align better with the line reading "Monday: Closed"

    I also styled a paragraph class for more control over the leading after the first line..there's probably a better way of doing that :/

    Any suggestions?
    Thanks

    CSS
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Untitled Document</title>
    <style type="text/css">
    .kern {
    	text-indent: 5px; }
    .trading {
    	font-family: Georgia;
    	font-size: 14px;
    	color: #3e2c1e;
    	width: 175px;
    	position: relative;
    	right: -780px;
    	line-height: 20px; }
    .space { 
    font-size: 8px;
    line-height: 0px; }
    </style>
    </head>
    HTML
    Code:
    <body>
    <div id="wrapper">
    <div class="trading">
    <strong>Opening Hours:</strong><br />
    <p class="space"></p>
    Monday: <i>Closed</i><br />
    <span class="kern">Tues-Fri: <i>7.30am-4.30pm</i><br /></span>
    Sat-Sun: <i>8am-4pm</i></div>
    </div>
    </body>
    </html>

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,672
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello rizzledon,
    Maybe it would work as a list instead. You can style the dt and dd seperately as needed -
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Untitled Document</title>
    <style type="text/css">
    html, body {
    	margin: 0;
    	font: 14px Georgia, "Times New Roman", Times, serif;
    	color: #3e2c1e;
    	background: #fc6;
    }
    #wrapper {
    	width: 800px;
    	margin: 50px auto;
    	padding: 50px 0 300px;
    	overflow: auto;
    	background: #0c6;
    }
    .trading {
    	width: 175px;
    	float: right;
    	background: #fff;
    }
    h1 {
    	font-size: 1.2em;
    	color: #006600;
      text-align: center;
    	text-decoration: underline;
    }
    .trading dt {
    	float: left;
    	clear: left;
    	width: 55px;
    	text-align: left;
    	padding: 0 0 0 5px;
    }
    </style>
    </head>
    <body>
        <div id="wrapper">    
            <div class="trading">        
                <h1>Opening Hours:</h1>
                <dl>
                    <dt>Monday</dt>
                        <dd>: Closed</dd>
                    <dt>Tues-Fri</dt>
                        <dd>: 7.30am-4.30pm</dd>
                    <dt>Sat-Sun</dt>
                        <dd>: 8am-4pm</dd>
                </dl>
            <!--end .trading--></div>
        <!--end wrapper--></div>
    </body>
    </html>
    That's based on this example.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • Users who have thanked Excavator for this post:

    rizzledon (12-20-2012)


  •  

    Tags for this Thread

    Posting Permissions

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