/    Sign up×
Community /Pin to ProfileBookmark

vertical-align question

i want to use vertical-align: middle; but i have seen it posted on other threads that it isnt supported by all or something. Could i get a little help on this. also, if it isnt supported what could i use? thx

to post a comment
CSS

7 Comments(s)

Copy linkTweet thisAlerts:
@Paul_JrAug 11.2004 — I don't know how well it's supported, but according to the W3C it only applies to inline and table-cell elements.

You can see [url=http://www.w3.org/TR/REC-CSS2/propidx.html]here, at the Property Index[/url], look down near the bottom.
Copy linkTweet thisAlerts:
@pawkyauthorAug 11.2004 — ok, thx. also could u tell me what are inline elements. Im still getting used to the terminology a little ? thx ?
Copy linkTweet thisAlerts:
@Paul_JrAug 11.2004 — Inline elements are things like the [SIZE=1]STRONG[/SIZE], [SIZE=1]SPAN[/SIZE], and [SIZE=1]IMG[/SIZE] elements. They go with the flow of the text; they will stack horizontally, you cannot legally apply width, height, padding, or margin to any of these elements. Block-level elements (like [SIZE=1]DIV[/SIZE] and [SIZE=1]P[/SIZE]) on the other hand, take up the entire width of their containing element; they stack vertically. That's why you have to float two [SIZE=1]DIV[/SIZE]s to get them to sit next to each other.
Copy linkTweet thisAlerts:
@pawkyauthorAug 11.2004 — ok, cool thx. not sure how vertical-align would actually do anything w/ those though ? i just tryied using it w/ span and it didnt do anything like i thought >.< thx for the help, now to figure something else out ?
Copy linkTweet thisAlerts:
@Paul_JrAug 11.2004 — [i]Originally posted by pawky [/i]

[B]ok, cool thx. not sure how vertical-align would actually do anything w/ those though ? i just tryied using it w/ span and it didnt do anything like i thought >.< thx for the help, now to figure something else out ? [/B][/QUOTE]

Yeah, I've had sketchy support (okay, none at all) with [size=1]VERTICAL-ALIGN[/size], so I don't normally use it (can't remember the last time I did).


You can [url=http://www.w3.org/Style/CSS/Test/CSS1/current/test544.htm]look here[/url] to see some examples.

Here's sort of an example:

[b]CSS:[/b]
[size=1]
p {
padding: 2em 0.5em;
text-align: center;
border: 1px solid #000;
}
p span {
vertical-align: super;
}
[/size]

[b]Code:[/b]
[size=1]
&lt;p&gt;This is a &lt;span&gt;paragraph&lt;/span&gt;.&lt;/p&gt; [/size]
Copy linkTweet thisAlerts:
@pawkyauthorAug 11.2004 — oh, ok. i guess i c now. what a pain though >.< they should have made it for block elements as well ? well, thx for the help ill c how i can use it ?
Copy linkTweet thisAlerts:
@DaveSWAug 11.2004 — alternatives I use include:

margins or padding if possible.

line-height if it's a one line thing to be vertically aligned, like a menu.
×

Success!

Help @pawky spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.6,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...