473,408 Members | 2,405 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

problem with text align

17
Hi Everyone . I am having problem with text align in CSS. I am using <li> element. I want to display text centered vertically i.e. it should be at equal distance from top and bottom. sorry for my bad english. thanks in advance.
May 24 '07 #1
3 1665
Hi Everyone . I am having problem with text align in CSS. I am using <li> element. I want to display text centered vertically i.e. it should be at equal distance from top and bottom. sorry for my bad english. thanks in advance.
Have a look at the padding or margin styling of the element containing the text. Try the padding first, if that doesn't do what you want try the margin. Depending on the rest of your layout and what you're trying to achieve you may have to place a div around the text and apply the padding to that, i.e

[HTML]
<li style="padding:5px 0px 5px 0px;">
some text
</li>

or

<li>
<div style="padding:5px 0px 5px 0px;">some text</div>
</li>
[/HTML]
May 24 '07 #2
xiaawan
17
Have a look at the padding or margin styling of the element containing the text. Try the padding first, if that doesn't do what you want try the margin. Depending on the rest of your layout and what you're trying to achieve you may have to place a div around the text and apply the padding to that, i.e

[HTML]
<li style="padding:5px 0px 5px 0px;">
some text
</li>

or

<li>
<div style="padding:5px 0px 5px 0px;">some text</div>
</li>
[/HTML]
Dear merseyside thank you for your quick reply.
applying padding or margin do not solve my problem. Actually my <li> element is 50px in height. applying padding-top and padding-bottom only makes spaces from top and down. is there any way that text starts from middle vertically and then moves up and down equally depending on the size of text. sorry for my bad english again.
May 24 '07 #3
drhowarddrfine
7,435 Expert 4TB
I don't understand because padding should do what you want. Try looking into line-height to see if that is what you want.
May 24 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: redneck_kiwi | last post by:
Hi all: I have a really weird problem. I am developing a customer catalog system for my company and as such have delved into sessions for authentication and access levels. So far, I have managed...
1
by: books1999 | last post by:
Hi there, I have a problem with this css/div and i cannot work it out. I would like either container to be able to push the background box to grow but in Firefox it overflows. Can someone find a...
8
by: knoxautoguy | last post by:
This problem has consumed a lot of my time, and I'm aftraid someone will tell me that my whole approach to this objective is wrong; however, I would like to know if there is a way to do this. I...
2
by: DC | last post by:
The Code <%@ import namespace="System" %> <%@ import namespace="System.Web" %> <%@ import namespace="System.Web.UI" %> <%@ import namespace="System.Web.UI.HtmlControls" %> <%@ import...
1
by: Trev | last post by:
Hi, I'm hoping that someone in this group can shed some light on an issue I'm having with a Formview. I have a Web User Control (.ascx) with a Formview. The Formview contains 2 Multiviews,...
5
by: althafexcel | last post by:
hi everyone Im trying to include an external js in my aspx page under the head tag, it doesn't load or it displays an object expected error whenver the function from the .js is called. Actually...
0
by: Jacob Donajkowski | last post by:
Once the user logs in I want to have the users switch from the Roster View to the Profile View and enter their profile infomation and save it. Then the next time they login and go to the Profile...
0
by: sjickells | last post by:
Hi I am having a problem using asp:TextBox's in a transparent table. I have a background image on the page and a table in the middle of the page. I have set the background colour of the table...
2
osward
by: osward | last post by:
Hello there, I am using phpnuke 8.0 to build my website, knowing little on php programing. I am assembling a module for my member which is basically cut and paste existing code section of...
8
by: cyqotiq | last post by:
First, let me state that this is not necessarily a Firefox problem, as I haven't fully tested in IE just yet. Second, let me state that this is not the typical "getElementById not working Firefox"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.