This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Stylesheets > July 2007 > <DIV> with a justify and padded text into





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 <DIV> with a justify and padded text into
Bob

2007-07-12, 6:16 am

He at all

I have a <DIV> with a long text and a <button> at the very bottom

I want to center the button and to justify the text and I want the
text-margin-left and right of 2em relative to the <div> nargin

How can I make the CSS please?

Regards


Jukka K. Korpela

2007-07-12, 6:16 pm

Scripsit Bob:

> I have a <DIV> with a long text and a <button> at the very bottom


I'd like to ask "why?" and "what's the URL?", but I'm afraid to ask. I still
have belief in the rationality of web authors left.

> I want to center the button and to justify the text and I want the
> text-margin-left and right of 2em relative to the <div> nargin
>
> How can I make the CSS please?


Is this an exercise? Can we send the replies directly to your teacher or
tutor? Then we could explain why it's a wrong exercise.

Here's a correct answer though (to the extent that wrong questions can have
right answers):

div { text-align: justify;
margin: 0 2em; }
button { display: block;
margin: 0 auto; }

To see one of the reasons why justification is seldom justified on web
pages, test this with a div containing nice long words like
supercalifragilisticexpialidocious, and use different window widths.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Bob

2007-07-12, 6:16 pm

"Jukka K. Korpela"
wrote without understand my idea

> Is this an exercise? Can we send the replies directly to your teacher or
> tutor? Then we could explain why it's a wrong exercise.
>
> Here's a correct answer though (to the extent that wrong questions can
> have right answers):
>
> div { text-align: justify;
> margin: 0 2em; }
> button { display: block;
> margin: 0 auto; }
>
> To see one of the reasons why justification is seldom justified on web
> pages, test this with a div containing nice long words like
> supercalifragilisticexpialidocious, and use different window widths.
>


Dear Mr."I know all",

It is not an exercise but only a little part of my site
I do not speack well your language but also you do not speack my
language...........................................
One time ago this NG was very kindly and there was not teachers like you
but only
friends..........................................................................
The code (right) that you wrote
do not work like my idea !!!!!!!!!!
Into the <div> I'ld want some justify text
The margin is of the text and not of the div and my problem is to position
the text into the div and button must be centered into the div
At last I am looking for a position absolute of the text and of the button
into the div
Many regards


John Hosking

2007-07-12, 6:16 pm

Bob wrote:
> "Jukka K. Korpela"
> wrote without understand my idea
>
>
> Dear Mr."I know all",


A poor choice of response from someone who wants help...

>
> It is not an exercise but only a little part of my site
> I do not speack well your language but also you do not speack my
> language.[...]
> One time ago this NG was very kindly and there was not teachers like you
> but only friends


Teachers *are* our friends. *Especially* for those who wish to learn.

> The code (right) that you wrote do not work like my idea ![...]
> Into the <div> I'ld want some justify text
> The margin is of the text and not of the div and my problem is to position
> the text into the div and button must be centered into the div
> At last I am looking for a position absolute of the text and of the button
> into the div


Perhaps you should provide a URL of your best attempt so far. I actually
thought Jukka's post accurately fulfilled your request while at the same
time explaining the pitfalls of doing what you said you wanted. So
that's at least two of us who didn't understand. Even on your second
attempt I don't get it. But if you try again, you might get more help if
you're nice about it.

> Many regards


More of the same to you.

--
John
Pondering the value of the UIP: http://blinkynet.net/comp/uip5.html
Ben C

2007-07-12, 6:16 pm

On 2007-07-12, Bob <bob@nospam.com> wrote:
> "Jukka K. Korpela"
> wrote without understand my idea
>
[...][color=darkred]
> do not work like my idea !!!!!!!!!!
> Into the <div> I'ld want some justify text
> The margin is of the text and not of the div and my problem is to position
> the text into the div and button must be centered into the div


Use padding instead of margin for that. So "padding: 0 2em;"

The button should be centered OK with the CSS given.

> At last I am looking for a position absolute of the text and of the button
> into the div


Not sure what you mean.
Bob

2007-07-12, 6:16 pm

"John Hosking"

wrote:


> A poor choice of response from someone who wants help...





Help?



It is a very strange way to help



>


> Perhaps you should provide a URL of your best attempt so far. I actually
> thought Jukka's post accurately fulfilled your request while at the same
> time explaining the pitfalls of doing what you said you wanted.
> ...............................................................................



> John



I have not still now wrote anything to show you because I do not understand
how to start.

My last idea was to position absolutely any thing (text, button, images
ecc....) into the <div> but I cannot understand how to do.

I positin best the div into the windows but not the element of the div into
the div



Regards


Bob

2007-07-13, 6:16 pm

"Ben C"

wrote:



> Not sure what you mean.


Thank you very much but what I want is different.

I know perfectly that it is very difficul for me to make questions in other
language.

I'ld like to know if it is possible to make a position:absolute of any
element like text or buttons or images INTO a <DIV>

Thank you in advance and best regards to all


Bergamot

2007-07-13, 6:17 pm

Bob wrote:
>
> I'ld like to know if it is possible to make a position:absolute of any
> element like text or buttons or images INTO a <DIV>


You can absolutely position anything, but that doesn't mean it is a wise
thing to do, or that it is really the best way to go about it.

We understand there is a language barrier here, so why don't you draw a
picture of what you want? Do a "mock up" in a graphics program, upload
it to a publicly accessible server and post the URL.

--
Berg
Ben C

2007-07-13, 6:17 pm

On 2007-07-13, Bergamot <bergamot@visi.com> wrote:
> Bob wrote:
>
> You can absolutely position anything,


[...]

Pretty much, yes, but you can't absolutely position a #text node, and
although you can absolutely position an inline node (e.g. a span) as
soon as you do it becomes implicitly display: block.

Absolutely positioning table cells is a bad idea too.
Bergamot

2007-07-13, 6:17 pm

Ben C wrote:
>
> Absolutely positioning table cells is a bad idea too.


Note that I did mention positioning isn't always wise. ;)

Seems more often than not, it's unwise.

--
Berg
Dr J R Stockton

2007-07-14, 6:18 pm

In comp.infosystems.www.authoring.stylesheets message <7gMli.63953$%k.20
0407@twister2.libero.it>, Fri, 13 Jul 2007 14:47:31, Bob
<bob@nospam.com> posted:
>
>I know perfectly that it is very difficul for me to make questions in other
>language.


Then write in both Italian and English.

--
(c) John Stockton, Surrey, UK. ???@merlyn.demon.co.uk Turnpike v6.05 MIME.
Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
In MS OE, choose Tools, Options, Send; select Plain Text for News and E-mail.
Don't quote more than is needed, and respond after each quoted part.
Bob

2007-07-20, 3:43 am



The <div> that I want to do is like the <duv> that appair into this page


http://www.dpopup.com/



If you scroll the page it appair a fixed position <div> that is like a
windows with a button



Best regards

(at all)


Sponsored Links


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