Zaloguj | Zarejestruj | FAQ
Anonymous

help with css float

+ Odpowiedz

Posty: 2 Strona 1 z 1


help with css float

przez Dayve » N mar 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>
Avatar użytkownika

Dayve

  • Posty: 2
  • Dołączył(a): N mar 23, 2014 1:03 pm

Re: help with css float

przez comport9 » So maja 31, 2014 1:03 am

Don't use float(ever). Try inline-block instead.
Avatar użytkownika

comport9

  • Posty: 28
  • Dołączył(a): N lis 04, 2012 5:35 pm


+ Odpowiedz

Strona 1 z 1