How to make two elements appear on the same line

  • Thread starter Thread starter Cal Who
  • Start date Start date
C

Cal Who

Some HTML elements seem to always start a new line.
Two <asp.Menu> elements, one after the other in the code, appear on two
lines even though there is no <br /> between them.
I would like them to be next to each other on the same line.
Can that be done?


Thanks
 
Cal Who said:
Some HTML elements seem to always start a new line.
Two <asp.Menu> elements, one after the other in the code, appear on two
lines even though there is no <br /> between them.
I would like them to be next to each other on the same line.
Can that be done?


Thanks
 
Cal Who said:
Some HTML elements seem to always start a new line.
Two <asp.Menu> elements, one after the other in the code, appear on two
lines even though there is no <br /> between them.
I would like them to be next to each other on the same line.
Can that be done?


Thanks
There's a lot to learn for asp.net. It all ends up as xhtml.
That's best styled with css and you want to know both.
I reckon you can get by with cut and paste for javascript but HTML and css
you need a reasonable understanding.

2 alternatives.
Table or divs.
Tables are usually sneered at nowadays.
So I'd wrap each with a div and both with another div.
style the two inner ones float:left
You may have to stick a both:clear in the mix as once you get that floating
going everything may want to join in.
But you can style a whole band with the background-colour on your outer div.
That also stops your next bit of html going on the same line.

You want to read up on css formatting - specifically table less pages.
Experiment a bit.
So next time you have to do layout you already understand how css and divs
can do it.

If I just tell you all the answers that may solve your immediate problem but
you don't learn nuthin, mate.
So if you think I'm being a bit mean. it's in your interest to think things
through for yourself.
 
Andy O'Neill said:
There's a lot to learn for asp.net. It all ends up as xhtml.
That's best styled with css and you want to know both.
I reckon you can get by with cut and paste for javascript but HTML and css
you need a reasonable understanding.

2 alternatives.
Table or divs.
Tables are usually sneered at nowadays.
So I'd wrap each with a div and both with another div.
style the two inner ones float:left
You may have to stick a both:clear in the mix as once you get that
floating going everything may want to join in.
But you can style a whole band with the background-colour on your outer
div.
That also stops your next bit of html going on the same line.

You want to read up on css formatting - specifically table less pages.
Experiment a bit.
So next time you have to do layout you already understand how css and divs
can do it.

If I just tell you all the answers that may solve your immediate problem
but you don't learn nuthin, mate.
So if you think I'm being a bit mean. it's in your interest to think
things through for yourself.

I did later think of a table an already did it.

Why are tables "sneered" at?
Suppose to use css?
Are div's not sneered at? They don't seem that different in effect. One
table vs three div's seems clearer.
I would think you'd float the left one right and the other left - so they
would be close. I did neither and browser spaces then nicely.

I am using css's more than when I stared.

If someone take the time to try to help I think he has the option of doing
it in any manner he pleases.


Thanks
 
Hilmar Bunjes said:
Am 09.04.2010 19:31, schrieb Cal Who:

This should help you:
http://www.webdesignfromscratch.com/html-css/css-block-and-inline.php

Best,
Hilmar

That's good reading. Maybe I did something's wrong but first I enclosed each
menu element in a span with no effect.
The I removed the spans and added Display:inline to the css class for the
menus. That also did nothing.
So I then put them into a table of one row and two columns and that fixed
it.

I'm new so I probably did not do the things I said I did exactly correct.

Thanks
 
Am 10.04.2010 18:59, schrieb Cal Who:
That's good reading. Maybe I did something's wrong but first I enclosed each
menu element in a span with no effect.
The I removed the spans and added Display:inline to the css class for the
menus. That also did nothing.
So I then put them into a table of one row and two columns and that fixed
it.

I'm new so I probably did not do the things I said I did exactly correct.

Maybe you can rearrange the entries via float
(http://webdesign.about.com/od/advancedcss/a/aa010107.htm). Put them all
as float:left and they will show up next to each other. After the menu
you should put a div with style="clear:both".

Best,
Hilmar
 
Why are tables "sneered" at?
Suppose to use css?
Are div's not sneered at? They don't seem that different in effect. One

Tables are fixed size and there's more potential for browser issues.
If you use divs and css they're more flexible but perhaps more importantly
more people will hire you.
 
Andy O'Neill said:
Tables are fixed size and there's more potential for browser issues.
If you use divs and css they're more flexible but perhaps more importantly
more people will hire you.
Thanks
 
Back
Top