Jump to content
  • 0

Ширина и отступы в дивах


Wellmanori
 Share

Question

CSS

body { margin: 0px; }
#d1, #d2, #d3, #d4, #d5 { padding: 0px 0px 0px 0px; }
#d1, #d4 { height: 100px; }
#d1 { background-color: red; }
#d2, #d3 {
height: 400px;
}
#d2 {
background-color: orange;
float: left;
width: 150px;
}
#d3 {
background-color: yellow;
float: right;
width: 1115px;
}
#d4 {
background-color: pink;
clear: both;
}

HTML

<body>

<div id="d1">text...</div>
<div id="d2">text...</div>
<div id="d3">text...</div>
<div id="d4">text...</div>

</body>

Результат: http://imgsave.ru/image-8D09_4E33E4FA.jpg

1) как зная разрешение экрана, установить два дива на всю ширину экрана? не в процентах

2) как убрать все отступы у текста от краев?

3) как поставить нужные отступы у текста не изменяя ширину дива?

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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