Jump to content
  • 0

Трехколоночный макет


Postal
 Share

Question

Решил сделать верстку слоями с помощью плавающих элементов.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN">
<html>
<head>
<title>Hellow world!</title>
</head>
<body style="margin:0; padding:0">

<div style="width:200px; padding:0; margin:0; height:100px; background-color:green; float:left; color:yellow;">
Первый
</div>
<div style="width:200px; height:100px; background-color:red; float:right;">
Третий
</div>
<div style="height:100px; background-color:blue; color:white;">
Второй
</div>




</body>
</html>

Все бы ничего да в ИЕ между средним слоем и двумя другими образуются нежелательные отступы, как от них избавится?

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

нуна так:

<!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=windows-1251" />
<title>Hello, world!</title>
<style type="text/css" media="screen">
* {margin:0; padding:0; border-width:0;}
#container {height:100px; float:right;}
#center {background-color:#00ff00; height:100px; position:relative;}
#left {float:left; width:200px; height:100px; background-color:#ff0000; position:relative;}
#right {float:right; width:200px; height:100px; background-color:#0000ff; position:relative;}
</style>
</head>

<body>

<div id="right">
правый
</div>

<div id="left">
левый
</div>

<div id="container">
<div id="center">
центральный
</div>
</div>

</body>
</html>

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.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   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.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy