Community Forums › Forums › Archived Forums › Design Tips and Tricks › center image going out of alignment in Firefox
Tagged: Custom post, firefox, genesis sample, image alignment
- This topic has 1 reply, 2 voices, and was last updated 9 years, 6 months ago by
Christoph.
-
AuthorPosts
-
August 27, 2015 at 2:04 am #163702
alysiamac
MemberHi,
This problem is starting to drive me nuts!!
I've created a portfolio custom post type, in an adaptation of Sample Child theme. It works perfectly in Chrome and Safari (not tested yet in IE (- eek!)), but in Firefox when the image is placed at the top of the post/page content and aligned center, it veers way off to the right of the screen and beyond.
This doesn't happen in standard blog posts, but I have set the featured image to display above the post title and content. Nor does it happen if you add a space above the image in the content. All other images below the image at the top of the post align center with no problem.
Any ideas on what I need to do to fix this???
I'm wondering if I need to add something to this line from the css:
img.centered, .aligncenter { display: block; margin: 0 auto 24px; }
Pasting the code for the portfolio below, in case that gives any clues.
Many thanks in advance!
Alysia
/* ## portfolio ------------------------------------------------------------ */ .post-type-archive-portfolio .portfolio { float: left; margin: 0 15px 30px; width: 370px; } body.archive.post-type-archive-portfolio .entry:first-child { padding-top: 30px; padding-top: 3rem; } .portfolio-featured-image a img { -moz-transition: all 0.2s ease-in-out; -webkit-transition: all 0.2s ease-in-out; border: 10px solid #f5f5f5; transition: all 0.2s ease-in-out; max-width: 100%; } .portfolio-featured-image a img:hover{ border: 10px solid #ddd; } .single-portfolio article.portfolio .entry-title { font-size: 36px; text-transform: none; } .single-portfolio #content { text-align: center; } .single-portfolio article.portfolio img { border: 10px solid #f5f5f5; } article.portfolio .built-with img { border: 2px solid #f5f5f5; padding: 4px; margin-right: 20px; display: block; float: left; } article.portfolio h2 { font-size: 24px; } article.portfolio .really_simple_share, article.portfolio .nr_related_placeholder { display: none; } article.portfolio .entry-title { float: left; font-size: 18px; padding: 10px 0 0; text-transform: uppercase; width: 100%; } article.portfolio .portnav { width: 50%; float: right; text-align: right; } .entry-header.porthead { padding: 40px 40px 24px; padding: 4rem 4rem 2.4rem; } @media only screen and (max-width: 768px) { article.portfolio .entry-title { width:100%; float:left; font-size: 16px; } article.portfolio .portnav { width: 100%; float: left; text-align: left; font-size: 14px; } } @media only screen and (max-width: 594px) { .post-type-archive-portfolio .portfolio { float: left; margin: 0 15px 30px; max-width: 100%; } article.portfolio .entry-title { width:100%; float:left; font-size: 14px; } article.portfolio .portnav { width: 100%; float: left; text-align: left; font-size: 14px; } article.portfolio .built-with img { border: 2px solid #f5f5f5; padding: 4px; margin-right: 10px; display: block; float: left; } .custom-fields h3 { font-size: 14px; } }
August 27, 2015 at 2:06 pm #163792Christoph
MemberHi Alisia,
can you share a link to the website in question?
Without seeing it, all I can recommend is to use a tool like https://jigsaw.w3.org/css-validator/
to check your css for errors.
Firefox seems to be the most unforgiving when it comes to css.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.