Quantcast
Channel: CSS center content inside div - Stack Overflow
Viewing all articles
Browse latest Browse all 10

Answer by joern for CSS center content inside div

$
0
0

The problem is that you assigned a fixed width to your .wrap DIV. The DIV itself is centered (you can see that when you add a border to it) but the DIV is just too wide. In other words the content does not fill the whole width of the DIV.

To solve the problem you have to make sure, that the .wrap DIV is only as wide as it's content.

To achieve that you have to remove the floating in the content elements and set the display property of the block levels elements to inline:

#partners .wrap { display: inline;} .wrap { margin: 0 auto; position: relative;}#partners h2 {color: #A6A5A5;font-weight: normal;margin: 2px 15px 0 0;display: inline;}#partners ul {display: inline;}#partners li {display: inline}ul { list-style-position: outside; list-style-type: none; }

Viewing all articles
Browse latest Browse all 10

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>