I’m starting to style my portfolio site but I’m having an issue when it comes to displaying the images. In my CSS, I’ve declared the list item to have a width of 230px but somehow WordPress is not complying and is setting its own width (see image attached). It’s also setting a margin on it’s own and I can’t seem to remove it, but I can add to it. Really odd.
It looks like they’re both 230px, unless you’re talking about it becoming 232px?
It’s becoming 232px because of your 1px border on each side. You have two simple options:
1. Make the width/height 228px
2. Give the li box-sizing: border-box and it will calculate width/height including borders and padding/margins.
@TheDoc Yeah, that’s what I read on Josh’s blog and one of the articles here. I really hate the way WordPress displays your markup in view source. The code is extremely misaligned and adds ridiculous amounts of spacing so using font-size: 0; was a perfect solution. Thanks Gray.
Viewing 9 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic.
*May or may not contain any actual "CSS" or "Tricks".