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 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Apr 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Simple blog style layout with divs - how?

    I would like to create a simple blog style layout like wordpress kubrick theme.
    http://img134.imageshack.us/img134/9523/blog.png
    here's html:
    Code:
    <html>
    <body>
    
    <div id="page">
       <div id="header">
          <h1>Title</h1>
       </div>
       <div id="left">
          <h2>Blog post</h2>
          <p>Hello world!</p>
       </div>
       <div id="right">
          <a href="#">Link 1</a><br>
          <a href="#">Link 2</a><br>
          <a href="#">Link 3</a><br>
          <a href="#">Link 4</a><br>
          and so on...
       </div>
       <div id="footer">
          Footer here
       </div>
    </div>
    
    </body>
    </html>
    Could someone do a simple css example for me? And correct if there's something wrong in the HTML

  • #2
    New Coder
    Join Date
    Mar 2009
    Location
    Milton Keynes, England
    Posts
    54
    Thanks
    4
    Thanked 4 Times in 4 Posts

  • #3
    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 sitruuna,
    A very basic one here. Might get you started -
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.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 {
    	font: 14px "Comic Sans MS";
    	background: #FC6;
    	text-align: center;
    }
    * {
    	margin: 0;
    	padding: 0;
    	border: none;
    }
    #page {
    	width: 600px;
    	margin: 30px auto;
    	background: #999;
    	overflow: auto;
    }
    #header {
    	background: #F69;
    	border-bottom: 2px solid #f00;
    }
    		#right {
    			width: 150px;
    			float: right;
    		}
    		ul#menu {
    			width: 147px;
    			list-style-type: none;
    		}
    		#menu li a {
    			display: block;
    			color: #000;
    			text-decoration: none;
    			width: 147px;
    			height: 30px;
    			line-height: 30px;
    			text-align: center;
    		}
    		#menu li a:hover {
    			color: #fff;
    			background: #Ff0000;
    		}
    .post {
    	margin: 0 155px 10px 5px;
    	text-align: justify;
    }
    .post h2, .post h3 {
    	text-align: left;
    	margin: 0 0 0 25px;
    }
    hr {
    	width: 80%;
    	height: 1px;
    	margin: 10px auto 25px;
    	background: #0f0;
    }
    #footer {
    	height: 25px;
    	line-height: 25px;	
    	background: #F69;
    }
    </style>
    </head>
    <body>
        <div id="page">
            <div id="header">
            	<h1>Title</h1>
            </div>
                    <div id="right">
                        <ul id="menu">
                            <li><a href="#">Link 1</a></li>
                            <li><a href="#">Link 2</a></li>
                            <li><a href="#">Link 3</a></li>
                            <li><a href="#">Link 4</a></li>
                            <li><a href="#">Link 5</a></li>
                            <li><a href="#">Link 6</a></li>
                        </ul>
                    <!--end right--></div>
                <div class="post">
                    <h2>Blog post</h2>
                    <h3>Hello world!</h3>
                        <p>
                            Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna 
                            aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no 
                            sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam 
                            nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo 
                            duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
                        </p>
                        	<hr />
                <!--end post--></div>
                <div class="post">
                    <h2>Blog post</h2>
                    <h3>Hello world!</h3>
                        <p>
                            Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna 
                            aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no 
                            sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam 
                            nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo 
                            duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
                        </p>
                        	<hr />
                <!--end post--></div>
            <div id="footer">
            	Footer here
            <!--end footer--></div>
        <!--end page--></div>
    </body>
    </html>
    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


  •  

    Posting Permissions

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