I have a css and HTML code which has two sections in the header: one for Logo and other one for navigation. I wanted to put both in the same line so that it saves some space and looks much better. Can som开发者_如何学编程eone guide me on how I can do that?
http://css.pastebin.com/AdGMQum5
- Set width for your logo for example 100px;
Float:left;
logo- Remove
width:100%;
andfloat:left;
from#nav
- Add
overflow:hidden;
for#nav
- add
clear:left;
for#content
Live example: http://jsbin.com/eyozo
The easiest method is simply to use a background-image
on the h1
element:
h1 {
padding-left: 200px; /* width of the image plus a 'buffer' between image and text */
height: 150px; /* vertical height of the image */
line-height: 150px; /* to vertically-align the image with the text */
background: #fff url(path/to/image.png) 0 0 no-repeat;
}
精彩评论