V
V
vladislavstarkov2011-01-16 00:54:29
css
vladislavstarkov, 2011-01-16 00:54:29

How to center-align one line of image and text in HTML/CSS?

Image not IMG, DIV with "background: url(images/supermega.png) no-repeat -990px ​​-860px;"

It turns out like this: [DIV] text text and more text

This line must be aligned in the middle of the parent element and provided that the width of the line can change dynamically (text in different languages, depending on the user's choice).

ideas?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
U
uadeveloper, 2011-01-16
@vladislavstarkov

Of course, I only get to know all the delights of marvelous layout, but my option is:
Set the parent element to text-align: center
Set the div with the background to display: inline-block;

V
vladislavstarkov, 2011-01-16
@vladislavstarkov

Thanks, this helped.

S
SkazochNik, 2011-01-17
@SkazochNik

margin: 0 auto;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question