css helpp

chanukadl

Junior member
  • Aug 8, 2008
    563
    19
    18
    1st create table or div with 100% width without any style then create ur site inside that machan karala balapan may be hariyai
     

    Lakshan-Seram

    Well-known member
  • May 31, 2011
    24,714
    12,619
    113
    127.0.0.1:8080/Kandy
    <div style="width:980px;margin-left:auto;margin-right:auto">
    <!-- contents here -->
    </div>

    this div should be the main wrapper for the page or if you need to do something different, you can align each div this way.
     
    Last edited:

    Lakshan-Seram

    Well-known member
  • May 31, 2011
    24,714
    12,619
    113
    127.0.0.1:8080/Kandy
    html tag eken passeda danna one

    inline css,

    <html>
    <head><title></title></head>
    <body style="margin:0">

    <div style="width:980px;margin-left:auto;margin-right:auto">
    <!-- contents here -->
    </div>

    </body>
    </html>


    internal css;
    <html>
    <head><title></title>
    <style type="text/css">
    body{margin:0}
    #wrapper{width:980px;margin-left:auto;margin-right:auto}
    </style>

    </head>
    <body>

    <div id="wrapper">
    <!-- all of the contents here -->
    </div>

    </body>
    </html>


    oke 980px kiyanne page eke width eka. one ganak danna puluwan. oya div eken contents align karanawa oya div eka asse thama anik ewwa ena one
     

    Lakshan-Seram

    Well-known member
  • May 31, 2011
    24,714
    12,619
    113
    127.0.0.1:8080/Kandy
    <!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>SAMPLE</title>
    <style type="text/css">
    body {
    margin: 0px;
    font-family: Verdana, Geneva, sans-serif;
    color: #666;
    font-size: 12px;
    }
    #wrapper {
    width: 980px;
    background-color: #CCC;
    margin-right: auto;
    margin-left: auto;
    }
    #wrapper .just-txt {
    margin: 0px;
    padding: 10px;
    }
    </style>
    </head>

    <body>
    <div id="wrapper">
    <p class="just-txt"><strong>Lorem Ipsum</strong> is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
    </div>
    </body>
    </html>
     

    EApubs

    Active member
  • Sep 2, 2010
    584
    64
    28
    inline css,

    <html>
    <head><title></title></head>
    <body style="margin:0">

    <div style="width:980px;margin-left:auto;margin-right:auto">
    <!-- contents here -->
    </div>

    </body>
    </html>


    internal css;
    <html>
    <head><title></title>
    <style type="text/css">
    body{margin:0}
    #wrapper{width:980px;margin-left:auto;margin-right:auto}
    </style>

    </head>
    <body>

    <div id="wrapper">
    <!-- all of the contents here -->
    </div>

    </body>
    </html>


    oke 980px kiyanne page eke width eka. one ganak danna puluwan. oya div eken contents align karanawa oya div eka asse thama anik ewwa ena one

    Yep... this should work! The margins should do the trick!