Jump to content
  • 0

padding в меню


moslem
 Share

Question

Столкнулся с такой проблемой, хочу сделать отступы от текста сверху и снизу по 5px и по бокам 10px делаю padding:5px 10px; у меня только по бокам отступы получается, а с сверху и снизу ничего не происходит.

http://jsfiddle.net/ha7ap/

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

проверь опере и в хроме!Gaspode


<!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>Документ без названия</title>
<style>
*{padding:0;margin:0}
span{padding:40px;
background:red;}
</style>
</head>

<body>
<span>ONE</span>
</body>
</html>

Link to comment
Share on other sites

  • 0

Оба работают, но верхний не видно (чтобы увидеть, попробуйте задать margin-top для body).

The vertical padding, border and margin of an inline, non-replaced box start at the top and bottom of the content area, and has nothing to do with the 'line-height'. But only the 'line-height' is used when calculating the height of the line box.
Edited by troll
  • Like 1
Link to comment
Share on other sites

  • 0

да работают ,но жаль что не так как display:inline-block;!padding-top пересекает другой padding-top и даже элемент строкой выше!

ДОЛБ****** одним словом


<!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>Документ без названия</title>
<style>
*{padding:0;margin:0}
body{margin-top:300px;}
span{padding-top:40px;border:1px solid red;}
</style>
</head>

<body>
<p>KOPPP</p>
<span style="background-color:#0FC">holi</span>
<p>KOPPP</p>
<span style="background-color:#FF9">holi</span>
<p>KOPPP</p>
<span>holi</span>
</body>
</html>

тебе легче стало когда минусанул???

Edited by dostel1
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