1 reply [Last post]
thestealthyfox
thestealthyfox's picture
Offline
newbie
Last seen: 6 years 2 weeks ago
Timezone: GMT+1
Joined: 2014-03-05
Posts: 3
Points: 5

So, I am trying to centre overlay text on my homepage slider using CSS.

I have managed to write the code below which centres my current text, however if I add another slide with shorter text, the text is no longer centred.

Also, in Firefox the text is slightly off centre.

Website is http://www.lemezanfridel.com

Can anyone see where I'm going wrong?

Thanks!

body.home .caption {
	margin: -50px 0 0 -50px;
	left: 13%;
	top: 50%;
	right: auto;
}
 
body.home .caption p {
	height: 50px;
	padding: 20px 40px;
	background: #3cc;
	background: rgba(51,204,204,.8);
	font-size: 2.3em;
	display: block;
	font-style: normal;
}

thestealthyfox
thestealthyfox's picture
Offline
newbie
Last seen: 6 years 2 weeks ago
Timezone: GMT+1
Joined: 2014-03-05
Posts: 3
Points: 5

Sorry, typo! Website is

Sorry, typo! Website is http://www.lemezandfridel.com