- This topic is empty.
Viewing 10 posts - 1 through 10 (of 10 total)
Viewing 10 posts - 1 through 10 (of 10 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Hey guys,
Trying to centre the text on the left column but everytime I create a css rule it effects the right column
https://tinyurl.com/mpelw6n
Can anyone please help, Im pulling my hair out
Regards,
Motion
We are unable to troubleshoot an image – we need to see their markup and CSS – but if you put up a reduced demo in CodePen, we’ll be able to offer suggestions.
Hi Beverleyh,
The url above is not an image, it’s a tinyurl link so google doesn’t index the URL :)
This ought to work:
.divTableCell:first-child {
text-align: center;
}
Edit – apart from the bottom two apparently…
Almost, looking to keep the text left aligned but centre the vertical space
.divTableCell:first-of-type {
text-align: center;
vertical-align: middle;
}
LOL! My mistake. I was skimming the forum on mobile and thought it was a tinypic URL! Probably couldn’t have been much use on mobile anyway in this case… although CodePens don’t come with the same limitations for mobile users so it’s worth keeping it in mind for the future :)
No worries Bev :) I do that sometimes too
Thank you Atelierbram that did the trick.
I think I’m prejudiced when it comes to centering, lol.
Didn’t even cross my mind it could be about vertical.
@motion2082 Have you see this article? https://css-tricks.com/centering-in-the-unknown/
Newer methods use flexbox:
http://codepen.io/Mottie/pen/GWQQeL
div {
display: flex;
height: 100%;
align-items: center;
justify-content: center;
}