Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Vertical Align Text

Featured Replies

Hello!

 

I've been trying to vertically centre some text on a site with no luck :(

I managed to get it to work in FF but not in IE. After more attempts im back to square one - not even working in FF!

 

I've googled how to's but cannot get it to work :( Can any of you guys give me a hand with this?

Here is the site: My link : and I am trying to get the text in the gray bar vertically aligned center.

Before and next to each flag image.

 

 

Thanks in advance.

  • Author

i'm trying to edit your page 'on the fly' but the structure of the page and the positioning of the divs are proving quite difficult :mellow::huh:

yeah its a template we use at work, so unless your used to the layout its tricky :)

hey up!

#flags {
color:#FFFFFF;
font-size:14px;
font-weight:normal;
height:42px;
margin-left:0;
padding-left:0;
position:absolute;
text-align:center;
top:106px;
width:900px;
z-index:5;
}

:)

This works in IE7 and Firefox - tested OK:-

#flags{                              
position:absolute;
height:42px;
width:800px;
margin-left:10px;
top:106px;
/*margin-left:650px;
top:28px;*/
color:#FFF;
font-size:14px;     line-height: 40px;
z-index:5;
font-weight:normal;
text-align:left;
padding-left:10px;
}

#flags a {
	color:#fff999; 
}
#flags img { vertical-align: middle; }	

.middle-text {
	padding:0 20px 0 0; /*was 0 20px 30px 0px;*/
}

#flags p {  
	display:inline;
	padding:0 20px 0px 0;        /*was 0 20px 30px 0px;*/
}

 

Essentially line-height increased to height of flags and bottom padding removed (not needed) and vertical-align: middle added.

  • Author

Thanks for the replies.

 

Wickham - it works a treat thank you.

I can know take a look and learn this technique.

 

Thanks again.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.