0

I need to position 2 divs alongside, first's width %20 of the page and second's width %80 of the page. I don't know which position I must give divs. Relative, fixed, absolute, inherit?

How can I do it?

Erdinç Özdemir
  • 1,363
  • 4
  • 24
  • 52
  • Check http://stackoverflow.com/questions/4882206/css-problem-to-make-2-divs-float-side-by-side http://stackoverflow.com/questions/5387392/how-to-get-these-two-divs-side-by-side http://stackoverflow.com/questions/5803023/how-to-place-two-divs-next-to-each-other http://stackoverflow.com/questions/9683254/align-2-divs-side-by-side – 000 Jul 23 '12 at 05:22
  • @Erdinc Before asking question do a search and try to see related answers first... – Amol M Kulkarni Feb 22 '13 at 07:40

2 Answers2

5

You can write like this:

.firstdiv{
width:20%;
float:left;
}
.secdiv{
 overflow:hidden;
}

Check this fiddle

Mr. Alien
  • 153,751
  • 34
  • 298
  • 278
sandeep
  • 91,313
  • 23
  • 137
  • 155
1

Don't give any position to divs just use float:left; and set the width to 80%(or 79%) and 20% as usual

div_first
{
float:left;
width:79%;
}
div_second
{
float:left;
width:20%;
}
bugwheels94
  • 30,681
  • 3
  • 39
  • 60