This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Stylesheets > November 2007 > from <style> tags to style=""





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author from <style> tags to style=""
Jean Pierre Daviau

2007-11-15, 6:17 pm

Hi to every one.

How can I manage to write this kind of css in a style="".

img {
width: 150 px;
height: 100 px;
text-align: center;
}

<img style=" img: ????????" src="" alt="|">

--
Thanks for your attention.

Jean Pierre Daviau
--
windows Xp
asus p4 s533/333/133
Intel(R) Celeron (R) CPU 2.00 GHz
Processor Radeon7000 0x5159 agp


Johannes Koch

2007-11-15, 6:17 pm

Jean Pierre Daviau schrieb:
> How can I manage to write this kind of css in a style="".
>
> img {
> width: 150 px;
> height: 100 px;
> text-align: center;
> }
>
> <img style=" img: ????????" src="" alt="|">


You don't need selectors in inline style. So it's just

<img style="width: 150px; height: 100px; text-align: center" ...>
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
John Hosking

2007-11-15, 6:17 pm

Jean Pierre Daviau wrote:

> How can I manage to write this kind of css in a style="".
>
> img {
> width: 150 px;
> height: 100 px;
> text-align: center;
> }
>
> <img style=" img: ????????" src="" alt="|">


Your question is how to move from embedded styles to inline styles.

Usually people go the other way, taking their in-line styles and moving
them to an embedded or external stylesheet, thereby centralising their
styles. But if you're sure this is what you want to do, here's how:

<img style="width:150px; height:100px; text-align:center;"
src="" alt="|">

150x100 is a pretty big divider image (based on your alt attribute).
Also, I don't know that the text-align:center will help much when
applied to an img element.

--
John
Jonathan N. Little

2007-11-15, 6:17 pm

John Hosking wrote:[color=darkred]
> Jean Pierre Daviau wrote:
>
^[color=darkred]
^
Also *no* whitespace here...

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Bergamot

2007-11-15, 6:17 pm

Jean Pierre Daviau wrote:
>
> How can I manage to write this kind of css in a style="".
>
> img {
> width: 150 px;
> height: 100 px;
> text-align: center;
> }


It's better to put the img width and height in as HTML attributes
because it will prevent the page from jumping all over as it loads. You
can override them in CSS if you really must.

As for text-align on an img, it isn't likely to do much. Per the specs,
text-align applies to block-level elements, table cells and inline
blocks. img is an inline element so the property should be ignored.

What is it you really want to do?

--
Berg
Jean Pierre Daviau

2007-11-16, 6:21 pm

>You don't need selectors in inline style.
So simple

> It's better to put the img width and height in as HTML
> attributes
> because it will prevent the page from jumping all over as it
> loads. You
> can override them in CSS if you really must.

Ok

Thanks


Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews