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 Coder
    Join Date
    Oct 2009
    Location
    Rizal Province, Philippines
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Text and image flow

    I have a table 2 rows

    row 1 have 2 cols
    i merged the cols in the second row

    Col 1 in row 1 is section A
    Col 2 in row 1 is Section B
    Merged col in row 2 is Section C

    I put paragraph 1 in Section A, and image in B and paragraph 2 in C.

    Recently I turned to div layout,as I've learned that tables are bad practice.

    How can I make the same output using div. With the text and image flow together even if the window is resized, the image and texts will auto-adjust?
    Last edited by doctrin13th; 11-14-2009 at 03:59 AM.

  • #2
    Senior Coder
    Join Date
    Dec 2005
    Location
    Slovenia
    Posts
    1,963
    Thanks
    120
    Thanked 76 Times in 76 Posts
    post code or link to what you have.

  • #3
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello doctrin13th,
    Maybe something like this?
    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: 100.1% "Comic Sans MS";
    	background: #FC6;
    }
    * {
    	margin: 0;
    	padding: 0;
    	border: 0;
    	outline: 0;
    }
    #container {
    	margin: 30px auto 0; /*centers and puts top margin on #container*/
    	background: #999;
    	overflow: auto; /*clears the float*/
    	font-size: 0.8em;
    }
    	#logo {
    		height: 306px;
    		width: 183px;
    		margin: 0 20px 0 0;
    		float: right;
    		background: #f00; /*for testing*/
    	}
    #post {
    	margin: 0 auto; /*centers #post*/
    	background: #ccc;
    	overflow: auto;
    	font-size: 0.8em;
    }
    #container p, #post p {
    	margin: 20px 20px 20px 0;
    }
    </style>
    </head>
    <body>
        <div id="container">
        	<img src="image001.jpg" alt="logo" id="logo" />
                <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>
    <!--end container--></div>
        <div id="post">
            <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>
        <!--end post--></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
    •