The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Center horizontal line Reply To: Center horizontal line


A CodePen demo please… we need the HTML and CSS that applies to those elements and we need to see it showing the actual problem. Making an observation from what’s provided, there is nothing to suggest you’ve tried to centre the hr in those inline styles — maybe try autoing the left and right margins? — but we don’t know what other CSS is in play in order to suggest anything useful. Please use the developer toolbar to extract the relevant code from what you see when viewing your live website – that’s F12 in most browsers. Unfortunately, guessing wastes our time as well as yours, and folks won’t mock up loosely relevant demos for you because there’s a good chance they won’t work as expected. We need to see your code. Help us to help you.

General help: try Googling “how to center an element with CSS” and try some of the code you find on your travels.