Jump to content
php.lv forumi

Kā pareizi nocentrēt lapu ?


EdgarsK

Recommended Posts

Sveiki, nēesmu īsti css programmētājs, bet šo to piekopju.

Beidzot gribētos arī iemācīties kā pareizi centrēt lapas galveno rāmi.

 

<html>
<head>
  <style type="text/css">
    #main-container { width:1000px; text-align:left; }
  </style>
</head>
<body>
 <div align="center">
  <div id="main-container">
    ...
  </div>
 </div>
</body>
</html>

 

Šis ir variants kā es esmu darījis līdz šim. Ticu ka ir jābūt kaut kādam labākam variantam "margin: 20% 0" vai kautkā tā.

Būsu pateicīgs par atbildēm.

Paldies.

Link to comment
Share on other sites

phpjānis - paldies par atbalstu :)

 

 

Centrēt lapu

#wrap {
margin:0 auto;
width:1000px;
}

 

Noturēt scrollbar lai lapa nelēkātu brīžos kad ir/nav scrollbar

html {
 height: 100%;
 margin-bottom: 0.01em;
 overflow-y:scroll; /* firefox */
}

Edited by EdgarsA
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...