Reputation: 23
I made a website that is working fine on large devices ,on mobile device I am trying to center the icon below the slider using this code below in the class icn
.icn{
margin:0 auto;
}
but it is not centered. The website I made is in www.devmakk.com/tution
Upvotes: 1
Views: 82
Reputation: 9329
Centered content will also need a width applied to it if it is display:block
.
.icn{
margin:0 auto;
width:20px;
display:block; // this is needed.
}
Otherwise, the parent container will just need to have text-align:center;
on it.
Upvotes: 2
Reputation: 33
you can try this:
.icn{
margin-Left:auto;
margin-Right:auto;
}
Upvotes: 0
Reputation: 267
you have to change the display of the icon to block for example
.icn{
display:block
margin:0 auto;
}
Don't forget display:block otherwise it won't work
Upvotes: 0
Reputation: 14348
You can use text-align:center
If you provide your relevant code in a fiddle i woul have been able to test it
Upvotes: 0