Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Now take a look...

Reply
Thread Tools

Now take a look...

 
 
Ed Jay
Guest
Posts: n/a
 
      08-18-2005
Els <(E-Mail Removed)> wrote:

>Ed Jay wrote:
>
>> Els <(E-Mail Removed)> wrote:
>>
>>>Ed Jay wrote:
>>>
>>>> Mark Parnell <(E-Mail Removed)> wrote:
>>>>
>>>>>Previously in alt.html, Ed Jay <(E-Mail Removed)> said:
>>>>>
>>>>>> I'm having a heck of a time figuring out how to center text or boxes.
>>>>>
>>>>>http://dorward.me.uk/www/centre/
>>>>
>>>> Thanks, Mark. That was a great help.
>>>>
>>>> Allow me to impose and ask another question. I'm trying to center a box
>>>> with text aligned both left and right. Example:
>>>> Test1 Test2
>>>>
>>>> I defined a simple box as:
>>>>
>>>> .menu {
>>>> border: 1px solid black;
>>>> margin-left: auto;
>>>> margin-right: auto;
>>>> width: 300px;
>>>> }
>>>>
>>>> The code on my page is:
>>>>
>>>> <div class=menu style="text-align: left;">Test1<div
>>>> style="text-align:right;">Test2</div></div>
>>>>
>>>> The result is:
>>>>
>>>> Test1
>>>> Test2
>>>>
>>>> Why?
>>>
>>>Because ...
>>>Well, add a visible border to each div, and you will know
>>>
>>>To make it work, you should float the first one left, and give it 50%
>>>width (probably a bit less to make it work in other browsers too), and
>>>give the second one a left margin of 50%.

>>
>> Thank you again. I'm going to have to translate what you've said into code
>> I understand, but it's 1:30AM and I can't focus my eyes any longer. It's
>> obviously past my bedtime.

>
>You're in Australia? (or Japan?) Go to bed! The European crew will
>take over from here, your turn will come again


Near Los Angeles.
>
>Sleep well


I had nightmares about CSS. )

OK, I came up with the following 'solution' that does what I want, a
centered line of two single words--one to the left and one to the right,
but it seems terribly clumsy. Can it be simplified?

<div style=" margin-left: auto; margin-right: auto; width: 300px;
text-align: center;"><div style="text-align: left; width: 40%; float:
left;">Test1</div><div style="text-align: right;"><div
style="text-align:right; width:40%;">Test2</div></div></div>

Ed Jay (remove M to respond)
 
Reply With Quote
 
 
 
 
Nicknamezj
Guest
Posts: n/a
 
      08-18-2005
Don't use the center tag, use the CSS of you class "xx" and center it
in the CSS
Like so...

xx {
text-align: center;
}

~Nick

 
Reply With Quote
 
 
 
 
dorayme
Guest
Posts: n/a
 
      08-18-2005
> From: Els <(E-Mail Removed)>
>
> Makes me wonder: how come the USA haven't managed to turn the tables
> and make themselves be first timewise...
>

Apparently, Rumsfeld has a plan for this, but is distracted at the moment...

dorayme

 
Reply With Quote
 
Mark Parnell
Guest
Posts: n/a
 
      08-18-2005
Previously in alt.html, Edwin van der Vaart
<(E-Mail Removed)> said:

> How about Alice Springs or Tennant Creek.


How do you know so much about Australia? I wouldn't have thought anyone
outside Australia (or most people inside for that matter) had even heard
of Tennant Creek! Let alone spelt it correctly!

--
Mark Parnell
http://www.clarkecomputers.com.au
alt.html FAQ :: http://html-faq.com/
 
Reply With Quote
 
Mark Parnell
Guest
Posts: n/a
 
      08-18-2005
Previously in alt.html, Ed Jay <(E-Mail Removed)> said:

> OK, I came up with the following 'solution' that does what I want, a
> centered line of two single words--one to the left and one to the right,


It shouldn't. Not in a behaving browser, anyway. Let me guess, you're
testing in IE, with no doctype?

> but it seems terribly clumsy. Can it be simplified?


Eek! That *is* dreadful.

<div style="float: left; width: 49%;">Test 1</div><div style="width:
49%; text-align: right;">Test 2</div>

--
Mark Parnell
http://www.clarkecomputers.com.au
alt.html FAQ :: http://html-faq.com/
 
Reply With Quote
 
rf
Guest
Posts: n/a
 
      08-18-2005
Edwin van der Vaart wrote:
> rf wrote:


> > But... nobody goes out there

> Yeah you're right. Every one lives under ground in Cooper.
> How about Alice Springs or Tennant Creek.


Last time I was in the Alice it was 30 degrees and bucketing down rain.
Nice. Even saw rain on the rock, a most unusual event.

Never been to Tennant Creek.

Still, it *is* a newsworthy event if the maximum anywhere is above 40.

Cheers
Richard.


 
Reply With Quote
 
rf
Guest
Posts: n/a
 
      08-18-2005
Mark Parnell wrote:

> Previously in alt.html, Edwin van der Vaart
> <(E-Mail Removed)> said:
>
> > How about Alice Springs or Tennant Creek.

>
> How do you know so much about Australia? I wouldn't have thought anyone
> outside Australia (or most people inside for that matter) had even heard
> of Tennant Creek! Let alone spelt it correctly!


He lucked out with Coober Pedy though

<aside>
I saw a poll somewhere years ago. IIRC something like 20% of people living
in Sydney have never been to the other side of the Blue Mountains. Scary.
</aside>

Cheers
Richard.


 
Reply With Quote
 
Mark Parnell
Guest
Posts: n/a
 
      08-18-2005
Previously in alt.html, rf <@invalid.com> said:
> Mark Parnell wrote:
>> of Tennant Creek! Let alone spelt it correctly!

>
> He lucked out with Coober Pedy though


True. Didn't notice that one, probably because I snipped it from my
reply.

> <aside>
> I saw a poll somewhere years ago. IIRC something like 20% of people living
> in Sydney have never been to the other side of the Blue Mountains. Scary.
> </aside>


My wife used to work with someone who (until they had to for work) had
never been West of the Anzac Bridge (aka Madonna's Bra for the
non-Sydneysiders).

--
Mark Parnell
http://www.clarkecomputers.com.au
alt.html FAQ :: http://html-faq.com/
 
Reply With Quote
 
Mark Parnell
Guest
Posts: n/a
 
      08-18-2005
Previously in alt.html, rf <@invalid.com> said:

> Last time I was in the Alice it was 30 degrees and bucketing down rain.
> Nice. Even saw rain on the rock, a most unusual event.


Rain certainly is an unusual event.

> Never been to Tennant Creek.


Nor have I, though I know someone who used to live there.

--
Mark Parnell
http://www.clarkecomputers.com.au
alt.html FAQ :: http://html-faq.com/
 
Reply With Quote
 
Ed Jay
Guest
Posts: n/a
 
      08-19-2005
Mark Parnell <(E-Mail Removed)> wrote:

>Previously in alt.html, Ed Jay <(E-Mail Removed)> said:
>
>> OK, I came up with the following 'solution' that does what I want, a
>> centered line of two single words--one to the left and one to the right,

>
>It shouldn't. Not in a behaving browser, anyway. Let me guess, you're
>testing in IE, with no doctype?


Actually, I was testing in Homesite's built-in browser. It didn't work in
Opera.
>
>> but it seems terribly clumsy. Can it be simplified?

>
>Eek! That *is* dreadful.


I think we think alike.
>
><div style="float: left; width: 49%;">Test 1</div><div style="width:
>49%; text-align: right;">Test 2</div>


Thank you very much. I want 'Test1' to align left, and I'd like the entire
line to be narrow. I defined a box as follows:

..menu2 {
margin-left: auto;
margin-right: auto;
width: 400px;
text-align: center;
}

My ensuing total code looks like:

<div class=menu2><div style="float: left; width: 49%; text-align:
left;">Test 1</div><div style="width: 49%; text-align: right;">Test
2</div></div>

It works in Opera, Firefox and IE. Is there anything "CSS illegal" about
what I ended up with?

Thanks again, and BTW, sorry about sending the above via email. It was a
slip of the keyboard

Ed Jay (remove M to respond)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Do people who take CCNA or MCSA also take A+ certification exam? Win.Tin.Mar@gmail.com MCSE 18 04-11-2008 03:46 PM
Do I have to take 292 & 296 can I take the 4 cores instead? =?Utf-8?B?SmltIEhvbGxvd2F5?= Microsoft Certification 6 06-02-2007 02:12 AM
Take a slow ride....take it eeee-zy ellis_jay Computer Support 0 08-25-2005 01:31 AM
Re: Doesn't Take Much To Take Over A Group Soapy Digital Photography 59 09-13-2004 05:55 AM
Do I have to take MS courses in order to take the exams? Ionut Marin MCAD 1 02-09-2004 02:24 PM



Advertisments