Align image to center on an article

GK User
Thu Jun 13, 2013 4:50 am
Hi,

I am trying to aling an image to center on an article but always appear in the right or left position.

I couldn't upload a picture I am sorry.
User avatar
Junior Boarder

GK User
Thu Jun 13, 2013 4:56 am
This really depends on which article item or any other element used in article so please post a link to your page so we can check.

See you around...
User avatar
Platinum Boarder

GK User
Thu Jun 13, 2013 5:08 am
normanUK wrote:This really depends on which article item or any other element used in article so please post a link to your page so we can check.

See you around...


I sent you the information on a private message.

Thank you for your help
User avatar
Junior Boarder

GK User
Thu Jun 13, 2013 5:31 am
You can do following ways.

If you want all images to be centered in your contents then use below css code and add it to override.css located in template/css folder. Enable css override option in template settings > advanced settings > css override "on".

Code: Select all
.articleContent img {
    float: none!important;
    margin-left: auto!important;
    margin-right: auto!important;
    display: block!important;
}


If you want to center only certain images then while in editor switch to html source mode and use following in img tag of your image.
Code: Select all
style="margin-left:auto; margin-right:auto; float:none;"

Example for your first image.
Currently you have following.
Code: Select all
<p>
<img src="/UNA/images/UNA/RECURSOS/DIRECCION/Evaluacion-tecnica-inst/foto-divulgacionaautoins.jpg" alt="foto-divulgacionaautoins">
</p>

With added style.
Code: Select all
<p>
<img src="/UNA/images/UNA/RECURSOS/DIRECCION/Evaluacion-tecnica-inst/foto-divulgacionaautoins.jpg" alt="foto-divulgacionaautoins" style="margin-left:auto; margin-right:auto; float:none;">
</p>


See you around...
User avatar
Platinum Boarder

GK User
Thu Jun 13, 2013 5:43 am
Now the image that I want is align center, thank you very much for your help
User avatar
Junior Boarder

GK User
Thu Jun 13, 2013 5:46 am
No problem at all, see you around...
User avatar
Platinum Boarder


cron