adam1h
asked on
I want to center my image horizontally with CSS3
Hi There,
I would like to center my logo and have it centered on the top navigation bar at all times, even if you reduce window size. The website does it, but I can't get it absolutely centered
/* the company logo */
#navigationBarLogo
{
display: block
vertical-align: top;
margin-left:auto;
margin-right:auto;
margin-top:-75px;
display: table;
/*margin-right:20px;*/
}
Please help in finding out why. Also, I would like to have nothing 'overlapping' on top of the logo if the client reduces his browser window size.
MANY THANKS !
Adam
I would like to center my logo and have it centered on the top navigation bar at all times, even if you reduce window size. The website does it, but I can't get it absolutely centered
/* the company logo */
#navigationBarLogo
{
display: block
vertical-align: top;
margin-left:auto;
margin-right:auto;
margin-top:-75px;
display: table;
/*margin-right:20px;*/
}
Please help in finding out why. Also, I would like to have nothing 'overlapping' on top of the logo if the client reduces his browser window size.
MANY THANKS !
Adam
Use align:center; instead of /*margin-right:20px;*/
Thanks
Edwin
Thanks
Edwin
ASKER
Hi Ewin,
thanks for your very quick reply on this
Tried and added align:center but my logo seems to be sitting on the left more than staying centered
:-(
Adam
thanks for your very quick reply on this
Tried and added align:center but my logo seems to be sitting on the left more than staying centered
:-(
Adam
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Since you are trying to make your site responsive, you can roll your own media queries for each scenario. I find tweaking this from scratch always sounds easy but as you dive in it is much more involved. I have used bootstrap http:Q_28406542.html#a39982826 and foundation.zurb.com as starting points for my responsive sites.
Take a look at the example link you can see it is very easy and quick to work with once you get over a very short learning curve.
Take a look at the example link you can see it is very easy and quick to work with once you get over a very short learning curve.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Add to the anchor tag surrounding the image, though I don't see the purpose of centering the image when it covers other things.
display: block;
margin: auto;
width: 190px;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
https://www.joe-cool.co.uk/3_0/Home.cfm