登录 | 注册 | FAQ
Anonymous

help with css float

+ 发表回复

2 篇帖子 分页: 1 / 1


help with css float

Dayve » 周日 3月 23, 2014 1:21 pm

I am trying to float my four links so that it is lineal and one next to the other. I am fairly new to CSS, so please bear with me. I have endlessly tried different positions properties and yet can not achieve what I want. Thanks
<!DOCTYPE html>
<html>
<head>
<style>
body{
margin:1px;
background:green;
}
.topbar
{
background:url(topbar.gif);
position:absolute;
top:5px;
right:15px;
margin:2px;
width:1200px;
height:100px;

}

.navbar
{
position:absolute;
float:right;
width:1200px;
height:100px;
border-style:groove;
}


a:link {text-decoration:none;color:yellow;}
a:hover{color:red;}
#titlename
{
position:relative;top:10px;
text-align:center;

}




</style>
</head>
<body>

<div class="topbar">
</div>
<div id="titlename">
<img src="title.gif" alt="title">
</div>

<div class="navbar">
<div class="button"><a href="#" target="_blank">HOME</a>
<div class="button"><a href="#" target="_blank">ABOUT</a>
<div class="button"><a href="#" target="_blank">LINKS</a>
<div class="button"><a href="#" target="_blank">CONTACT</a>
</div>

</body>
</html>
头像

Dayve

  • 帖子: 2
  • 注册: 周日 3月 23, 2014 1:03 pm

Re: help with css float

comport9 » 周六 5月 31, 2014 1:03 am

Don't use float(ever). Try inline-block instead.
头像

comport9

  • 帖子: 28
  • 注册: 周日 11月 04, 2012 5:35 pm


+ 发表回复

分页: 1 / 1