473,386 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

2 divs on same line

Hi

i have a requirement for the following layout in my masterpage:

1 div for header
1 div for footer

Between those divs i want a div for the left menu, then a div for the
content in the center, then inside each i will place a content holder for
other pages to inherit off

My problem is a div creates a new line? And everyone says not to use tables
anymore, so how do you get that look with css?

Thanks
Jan 24 '07 #1
14 1885
Use "float"

<div>
Header
</div>
<div>
<div style="float:left;">
Left
</div>
<div style="float:left;">
Right
</div>
</div>
<div style="clear:both;">
Footer
</div>

The "clear" on the footer means it acts like a normal div and won't float to
the edge of the div before.

"Daniel" <Da*****@vestryonline.comwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
Hi

i have a requirement for the following layout in my masterpage:

1 div for header
1 div for footer

Between those divs i want a div for the left menu, then a div for the
content in the center, then inside each i will place a content holder for
other pages to inherit off

My problem is a div creates a new line? And everyone says not to use
tables anymore, so how do you get that look with css?

Thanks

Jan 24 '07 #2
Hi,

Daniel wrote:
Hi

i have a requirement for the following layout in my masterpage:

1 div for header
1 div for footer

Between those divs i want a div for the left menu, then a div for the
content in the center, then inside each i will place a content holder for
other pages to inherit off

My problem is a div creates a new line? And everyone says not to use tables
anymore, so how do you get that look with css?

Thanks
You can use SPAN instead of DIV, because they are not block elements, so
they are not placed underneath each other.

Alternatively, you can use the CSS "position" property set to "absolute"
or "relative" to place DIVs outside of their block position.

HTH,
Laurent
--
Laurent Bugnion [MVP ASP.NET]
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Jan 24 '07 #3
If you want to impress someone by having a table-less css layout, be prepare
to spend next few days on learning and practicing.

If you want a simple and reliable solution, use tables.

And yes, by default a div will render on a separate line.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Daniel" <Da*****@vestryonline.comwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
Hi

i have a requirement for the following layout in my masterpage:

1 div for header
1 div for footer

Between those divs i want a div for the left menu, then a div for the
content in the center, then inside each i will place a content holder for
other pages to inherit off

My problem is a div creates a new line? And everyone says not to use
tables anymore, so how do you get that look with css?

Thanks

Jan 24 '07 #4
Not looking to impress anyone but i am looking to do things in the
considered 'right way' and stay on top of the present best methods and
techniques.

Thanks for all the help guys.

"Eliyahu Goldin" <RE**************************@mMvVpPsS.orgwrote in
message news:Og**************@TK2MSFTNGP03.phx.gbl...
If you want to impress someone by having a table-less css layout, be
prepare to spend next few days on learning and practicing.

If you want a simple and reliable solution, use tables.

And yes, by default a div will render on a separate line.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Daniel" <Da*****@vestryonline.comwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
>Hi

i have a requirement for the following layout in my masterpage:

1 div for header
1 div for footer

Between those divs i want a div for the left menu, then a div for the
content in the center, then inside each i will place a content holder for
other pages to inherit off

My problem is a div creates a new line? And everyone says not to use
tables anymore, so how do you get that look with css?

Thanks


Jan 24 '07 #5
Hi Aidy, used your idea nd it worked.

But when i drop a content placeholder inside the div, it takes up the whole
line again? Any ideas?

"Aidy" <ai**@noemail.xxxa.comwrote in message
news:1t******************************@bt.com...
Use "float"

<div>
Header
</div>
<div>
<div style="float:left;">
Left
</div>
<div style="float:left;">
Right
</div>
</div>
<div style="clear:both;">
Footer
</div>

The "clear" on the footer means it acts like a normal div and won't float
to the edge of the div before.

"Daniel" <Da*****@vestryonline.comwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
>Hi

i have a requirement for the following layout in my masterpage:

1 div for header
1 div for footer

Between those divs i want a div for the left menu, then a div for the
content in the center, then inside each i will place a content holder for
other pages to inherit off

My problem is a div creates a new line? And everyone says not to use
tables anymore, so how do you get that look with css?

Thanks


Jan 24 '07 #6
Ignore post about the contentholder, it does work.

Ok great all sorted thanks!
"Aidy" <ai**@noemail.xxxa.comwrote in message
news:1t******************************@bt.com...
Use "float"

<div>
Header
</div>
<div>
<div style="float:left;">
Left
</div>
<div style="float:left;">
Right
</div>
</div>
<div style="clear:both;">
Footer
</div>

The "clear" on the footer means it acts like a normal div and won't float
to the edge of the div before.

"Daniel" <Da*****@vestryonline.comwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
>Hi

i have a requirement for the following layout in my masterpage:

1 div for header
1 div for footer

Between those divs i want a div for the left menu, then a div for the
content in the center, then inside each i will place a content holder for
other pages to inherit off

My problem is a div creates a new line? And everyone says not to use
tables anymore, so how do you get that look with css?

Thanks


Jan 24 '07 #7
For years I have not been able to understand what's wrong with table layout.
May be because I am an application developer as opposed to a web designer.
Tables let your make a simple and neat layout and concentrate on your
application tasks. I guess web designers can achieve more with tableless
css. I prefer to leave it up to them. As far as I, the developer, am
concerned there is no reason to avoid tables.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Daniel" <Da*****@vestryonline.comwrote in message
news:uB**************@TK2MSFTNGP02.phx.gbl...
Not looking to impress anyone but i am looking to do things in the
considered 'right way' and stay on top of the present best methods and
techniques.

Thanks for all the help guys.

"Eliyahu Goldin" <RE**************************@mMvVpPsS.orgwrote in
message news:Og**************@TK2MSFTNGP03.phx.gbl...
>If you want to impress someone by having a table-less css layout, be
prepare to spend next few days on learning and practicing.

If you want a simple and reliable solution, use tables.

And yes, by default a div will render on a separate line.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Daniel" <Da*****@vestryonline.comwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
>>Hi

i have a requirement for the following layout in my masterpage:

1 div for header
1 div for footer

Between those divs i want a div for the left menu, then a div for the
content in the center, then inside each i will place a content holder
for other pages to inherit off

My problem is a div creates a new line? And everyone says not to use
tables anymore, so how do you get that look with css?

Thanks



Jan 24 '07 #8
I am a developer primarily, not a web designer but i am able to do both. I
agree i did all previous sites with table designs and it does seem the new
'best way' changes all the time. But for fear of a new 'All improved IE!'
being released that depricates tables in some form i want to ensure i am
always on the latest techniques because you just never know what the future
holds.


"Eliyahu Goldin" <RE**************************@mMvVpPsS.orgwrote in
message news:uW**************@TK2MSFTNGP03.phx.gbl...
For years I have not been able to understand what's wrong with table
layout. May be because I am an application developer as opposed to a web
designer. Tables let your make a simple and neat layout and concentrate on
your application tasks. I guess web designers can achieve more with
tableless css. I prefer to leave it up to them. As far as I, the
developer, am concerned there is no reason to avoid tables.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Daniel" <Da*****@vestryonline.comwrote in message
news:uB**************@TK2MSFTNGP02.phx.gbl...
>Not looking to impress anyone but i am looking to do things in the
considered 'right way' and stay on top of the present best methods and
techniques.

Thanks for all the help guys.

"Eliyahu Goldin" <RE**************************@mMvVpPsS.orgwrote in
message news:Og**************@TK2MSFTNGP03.phx.gbl...
>>If you want to impress someone by having a table-less css layout, be
prepare to spend next few days on learning and practicing.

If you want a simple and reliable solution, use tables.

And yes, by default a div will render on a separate line.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Daniel" <Da*****@vestryonline.comwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl.. .
Hi

i have a requirement for the following layout in my masterpage:

1 div for header
1 div for footer

Between those divs i want a div for the left menu, then a div for the
content in the center, then inside each i will place a content holder
for other pages to inherit off

My problem is a div creates a new line? And everyone says not to use
tables anymore, so how do you get that look with css?

Thanks



Jan 24 '07 #9
"Eliyahu Goldin" <RE**************************@mMvVpPsS.orgwrote in
message news:uW**************@TK2MSFTNGP03.phx.gbl...
For years I have not been able to understand what's wrong with table
layout. May be because I am an application developer as opposed to a web
designer. Tables let your make a simple and neat layout and concentrate on
your application tasks. I guess web designers can achieve more with
tableless css. I prefer to leave it up to them. As far as I, the
developer, am concerned there is no reason to avoid tables.
I couldn't agree more!
Jan 24 '07 #10
Tables won't be deprecated.

Tables (when used as a way to perform the overall layout) are quite rigid
and generally obscurs a bit the HTML source for the document.
Divs are likely more difficult to get right but you can change easily the
position without changing the HTML structure.

You'll see numerous discussions abotu their respective avantage/disavantage.

My intention is not to start yet another useless discussion. Just pick the
design your prefer...

---
Patrice

"Daniel" <Da*****@vestryonline.coma écrit dans le message de news:
e1**************@TK2MSFTNGP03.phx.gbl...
>I am a developer primarily, not a web designer but i am able to do both. I
agree i did all previous sites with table designs and it does seem the new
'best way' changes all the time. But for fear of a new 'All improved IE!'
being released that depricates tables in some form i want to ensure i am
always on the latest techniques because you just never know what the future
holds.


"Eliyahu Goldin" <RE**************************@mMvVpPsS.orgwrote in
message news:uW**************@TK2MSFTNGP03.phx.gbl...
>For years I have not been able to understand what's wrong with table
layout. May be because I am an application developer as opposed to a web
designer. Tables let your make a simple and neat layout and concentrate
on your application tasks. I guess web designers can achieve more with
tableless css. I prefer to leave it up to them. As far as I, the
developer, am concerned there is no reason to avoid tables.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Daniel" <Da*****@vestryonline.comwrote in message
news:uB**************@TK2MSFTNGP02.phx.gbl...
>>Not looking to impress anyone but i am looking to do things in the
considered 'right way' and stay on top of the present best methods and
techniques.

Thanks for all the help guys.

"Eliyahu Goldin" <RE**************************@mMvVpPsS.orgwrote in
message news:Og**************@TK2MSFTNGP03.phx.gbl...
If you want to impress someone by having a table-less css layout, be
prepare to spend next few days on learning and practicing.

If you want a simple and reliable solution, use tables.

And yes, by default a div will render on a separate line.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Daniel" <Da*****@vestryonline.comwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl. ..
Hi
>
i have a requirement for the following layout in my masterpage:
>
1 div for header
1 div for footer
>
Between those divs i want a div for the left menu, then a div for the
content in the center, then inside each i will place a content holder
for other pages to inherit off
>
My problem is a div creates a new line? And everyone says not to use
tables anymore, so how do you get that look with css?
>
Thanks
>




Jan 24 '07 #11

"Daniel" <Da*****@vestryonline.comwrote in message
news:e1**************@TK2MSFTNGP03.phx.gbl...
I am a developer primarily, not a web designer but i am able to do both. I
agree i did all previous sites with table designs and it does seem the new
'best way' changes all the time. But for fear of a new 'All improved IE!'
being released that depricates tables in some form i want to ensure i am
always on the latest techniques because you just never know what the
future
holds.
MS may have clout but I doubt even thye could deprecate tables even if they
wanted to.

Web developers and Application Developers have different goals. Web
Developers are primarily interested in delivering content in an engaging and
appealing way. They are interested in divorcing as much as possible the
content itself from the presentation. CSS is a big help there.

Application developers are delivering a UI in the sense that there is little
distinction between presentation and content its all just the UI. There is
greater emphasis on behaviour and input which in web development (apart from
navigation) is negligable.

What is best practice in Web Development may not be best practice in
Application Development.
Jan 24 '07 #12
"But for fear of a new 'All improved IE!'
being released that depricates tables in some form i want to ensure i am
always on the latest techniques because you just never know what the future
holds."

Importand words : "for fear of" and "in some form". I am not sayin they will
be depricated, just over stating my point that i prefer, personally, to do
what the crowd seem to be doing at any time...just in case.

"Anthony Jones" <An*@yadayadayada.comwrote in message
news:%2***************@TK2MSFTNGP06.phx.gbl...
>
"Daniel" <Da*****@vestryonline.comwrote in message
news:e1**************@TK2MSFTNGP03.phx.gbl...
>I am a developer primarily, not a web designer but i am able to do both.
I
agree i did all previous sites with table designs and it does seem the
new
'best way' changes all the time. But for fear of a new 'All improved IE!'
being released that depricates tables in some form i want to ensure i am
always on the latest techniques because you just never know what the
future
>holds.

MS may have clout but I doubt even thye could deprecate tables even if
they
wanted to.

Web developers and Application Developers have different goals. Web
Developers are primarily interested in delivering content in an engaging
and
appealing way. They are interested in divorcing as much as possible the
content itself from the presentation. CSS is a big help there.

Application developers are delivering a UI in the sense that there is
little
distinction between presentation and content its all just the UI. There
is
greater emphasis on behaviour and input which in web development (apart
from
navigation) is negligable.

What is best practice in Web Development may not be best practice in
Application Development.


Jan 24 '07 #13
Just like they say about paranoia - just because you're paranoid, doesn't
mean they're not out to get you.
So - remember, just because it's deprecated, doesn't mean it doesn't work!
(remember backwards compatibility)
:)
--
David Wier
MVP/ASPInsider
http://aspnet101.com
http://aspexpress.com
"Daniel" <Da*****@vestryonline.comwrote in message
news:Oo**************@TK2MSFTNGP02.phx.gbl...
"But for fear of a new 'All improved IE!'
being released that depricates tables in some form i want to ensure i am
always on the latest techniques because you just never know what the
future
holds."

Importand words : "for fear of" and "in some form". I am not sayin they
will
be depricated, just over stating my point that i prefer, personally, to do
what the crowd seem to be doing at any time...just in case.

"Anthony Jones" <An*@yadayadayada.comwrote in message
news:%2***************@TK2MSFTNGP06.phx.gbl...

"Daniel" <Da*****@vestryonline.comwrote in message
news:e1**************@TK2MSFTNGP03.phx.gbl...
I am a developer primarily, not a web designer but i am able to do
both.
I
agree i did all previous sites with table designs and it does seem the
new
'best way' changes all the time. But for fear of a new 'All improved
IE!'
being released that depricates tables in some form i want to ensure i
am
always on the latest techniques because you just never know what the
future
holds.
MS may have clout but I doubt even thye could deprecate tables even if
they
wanted to.

Web developers and Application Developers have different goals. Web
Developers are primarily interested in delivering content in an engaging
and
appealing way. They are interested in divorcing as much as possible the
content itself from the presentation. CSS is a big help there.

Application developers are delivering a UI in the sense that there is
little
distinction between presentation and content its all just the UI. There
is
greater emphasis on behaviour and input which in web development (apart
from
navigation) is negligable.

What is best practice in Web Development may not be best practice in
Application Development.


Jan 24 '07 #14
Hi,

Daniel wrote:
"But for fear of a new 'All improved IE!'
being released that depricates tables in some form i want to ensure i am
always on the latest techniques because you just never know what the future
holds."

Importand words : "for fear of" and "in some form". I am not sayin they will
be depricated, just over stating my point that i prefer, personally, to do
what the crowd seem to be doing at any time...just in case.
No shame in educating yourself. The best is to master both techniques
and to be able to choose the most suitable one given the project's
circumstances.

For example, mobile or older browsers often don't support CSS
positioning, in which case tables are useful. The more tools you master,
the more efficient you're as a software developer.

Greetings,
Laurent
--
Laurent Bugnion [MVP ASP.NET]
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Jan 24 '07 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Mel | last post by:
i need to have as many as 5 divs side by side on the same line without a break. if browser displays a horizontal scrollbar, its ok with my users and they can resize it. something like the...
2
by: tasman.hayes | last post by:
I'm experimenting with converting a site from a table layout to CSS. I'm floating three DIVs in a row for the top of a website (a logo, navigation buttons and a email list signup box). The DIVs...
8
by: rfox | last post by:
My parade of IE problems continues. I have two divs in the banner area of my website, one containing a photograph, the other the title and logo for the program. (Please see...
2
by: Arnost Sobota | last post by:
Hello, Suppose I want to play with DIVs as if they were type characters. I have a series of fixed-height (width is of no importance) blocks which must follow one another from left to right, with...
7
by: massic80 | last post by:
Hi everybody! I'm making a page for an exam at uni. In two DIV blocks of it there should appear (and disappear) some "icons", due to XML messages, so I dunno how many of them should I can obtain;...
4
by: Adam | last post by:
I have four roughly square DIVs, all the same height, which I need to line up horizontally across the page. What would be the best way to do this? At the moment I have a very botched solution where...
7
by: maya | last post by:
hi, I got this unusual design (well, not so unusual anymore, I guess..) for an input text field for a search form in top of page.. http://www.mayacove.com/design/search/search.html I can't...
7
by: rcw1983 | last post by:
I'm trying to get two divs on the same line....the problem I have is when the browser window gets smaller, the second div is being pushed below the first div....I want them to stay on the same...
0
by: Berlin Brown | last post by:
I have two DIVs on the same line, a left navigation frame and the right content. I want both of those items on the same line. Lets say the left nav content is 140pixels and the right content is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.