Jump to content
  • 0

vertical-align в div


SLameN
 Share

Question


<div class="head">
<img src="img/Logo.gif" width="57" height="56" class="logo">Сайт
</div>


#head {
width:500px;
height:70px;
background-image: url(../img/bg_l.jpg);
background-repeat: repeat-x;
}

.logo {
position: relative;
top:5px;
left:0;
}

Как сделать вертикальное выравнивание слова: "Сайт" по ценрту. vertical-align, padding - не работают... Если что-то не так, извините, сегодня прошел курс css :)

05518a0297d01735ffc403ba2fc79978.png

Edited by SLameN
Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

Додумался :)


<div id="head">
<h1>Сайт</h1>
</div>


#head {
height:56px;
background-color:#00CC99;
}

#head h1 {
padding:18px 0 0 60px;
text-align:left;
background-image:url(../img/Logo.gif);
background-repeat:no-repeat;
background-position:;
height:56px;
}

tini.kRyptoNite - я тебе не ставил минус

Link to comment
Share on other sites

  • 0

tini.kRyptoNite

Блочные элементы запихивать в строчный? строчный элемент будет первый в теле документа?извиняюсь - под "сайт" оказывается имелось в виду слово... :lol: все равно line-height надо указывать!

SLameN

.head{line-height:56px;}

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