CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

ASP.NET Web Hosting – 3 Months Free!



Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 2/6/2008 11:08:24 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 7 Views: 18 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
8 Items, 1 Pages 1 |< << Go >> >|
mlov83
Asp.Net User
Master Sheets with Stylesheets Question?2/6/2008 11:08:24 AM

0/0

After watching the very informative video with Cris Pells on the asp.learn website I decided to use Div's instead of Tables to create my website. However I want to keep the same look and feel of the website by making all my pages look the same. I have tried to used master pages with stylesheets and it works fine so long as my content placeholder does not exceeds the sises of one my columns. Is there a way around that? With tables the columns automatically Adjust but with Div's it appears to me that  you have to do all the adjustments yourself. Keep in mind that just like Chris I kept all my adjustment withing the CSS sheet.  Should I go back to using table or is there a self adjusting property that i can use with Div's?

 

Thank you all for your help.

orzeh
Asp.Net User
Re: Master Sheets with Stylesheets Question?2/6/2008 11:50:34 AM

0/0

hi!

you can use overflow: auto property to display scrollbar when content exceeds column size.

 

<div id="left_column" style="width: 300px; overflow: auto;">

</div>

 

orzeh 


code less, think more!
Dave Sussman
Asp.Net User
Re: Master Sheets with Stylesheets Question?2/6/2008 11:09:14 PM

0/0

I would always prefer the CSS route and certainly recommend it if possible, but you've discovered one of the flaws; when inexperienced in CSS it can take longer to get things looking the same as a table layout and looking the same in different browsers. The are great benefits from CSS but you always need to consider what your primary motive is; to get the site finished quickly or to spend longer but have better long term benefits.

If you're going to persevere with the CSS route then it's worth getting a couple of books (anything by Eric meyer, Andy Clarke, Jeffrey Zeldman) and spending time reading some of the css blogs (alistapart). Also, get hold of FireFox and the free FireBug plugin, which is great for CSS - you can edit the CSS live in the browser and see your changes live - great for experimenting.

Essentially divs are containers and expand to fi their content, unless explicitly sized (which can be percentage based). As orzeh says, a fixed width with overflow set will stop it expanding, or you can use a percentage width, meaning it will be a percentage of its container. Beware though, that there are issues with div sizes and content overflowing in IE6, so you might want to read up on the IE6 CSS bugs.

d

mlov83
Asp.Net User
Re: Master Sheets with Stylesheets Question?2/7/2008 11:51:43 AM

0/0

I have tried the overflow property and it looks like it can work. However I would like to have the long term logevity aspect of the site therefore i would like to stick to css's and div's. Can i ask then; unless i use the overflow property then my only other option would be to create 1css sheet per web page i put together? I mean is that my only option as far as div's go?  Dave thanks for the reply and the heads up on those books I wil get my hands on a couple of those by the end of day today. I'm not giving up on the CSS just yet I would like to fully understand my option before continuing with the build of the site. Tables seem pretty simple and from a begginers point of view more user friendly, but I dont know that they are the best design available. I'm still trying to educate myself on the pros and con's.

Thank you all for your responses.

 

Dave Sussman
Asp.Net User
Re: Master Sheets with Stylesheets Question?2/7/2008 11:57:39 AM

0/0

You definitely don't need a stylesheet per page. What I do is use Master Pages and have the CSS based layout within the master page; every page that uses the master page then automatically gets the CSS based design. Have a look at http://www.ipona.com/samples/2007/AGN202%20-%20CSS%20101.zip, which is a presentation (with sample) that I do on CSS.

Definitely stick with CSS if you can. It may take more time initially, but the skills you acquire can be reused in other sites.

d

mlov83
Asp.Net User
Re: Master Sheets with Stylesheets Question?2/7/2008 2:00:39 PM

0/0

Dave

On my last post what i was trying to get at was , that unless i used the overflow on the CSS sheet, my div's will not expand If my content exceeds one of the column heights.  Is there another way that when i put that Content Place Holder within the DIV that the div will automatically expand like tables do. Othewise im stuck using the overflow which then puts a small scroll bar within my text area which is fine but i was just trying to conceptualize my option.

Thanks for the presentation im going to get cracking on that tonight. It seems like I have alot to learn, and thanks for all the help thus far i really appreciated.

 

 

Dave Sussman
Asp.Net User
Re: Master Sheets with Stylesheets Question?2/7/2008 2:26:43 PM

0/0

Divs will expand with the content unless you set a fixed size (height, width or both). Consider:

<div id="foo">
    The quick brown fox jumped over the lazy dog. The quick brown fox jumped over the lazy dog.
    The quick brown fox jumped over the lazy dog. The quick brown fox jumped over the lazy dog.
    The quick brown fox jumped over the lazy dog. The quick brown fox jumped over the lazy dog.
    The quick brown fox jumped over the lazy dog. The quick brown fox jumped over the lazy dog.
    The quick brown fox jumped over the lazy dog. The quick brown fox jumped over the lazy dog.
</div> 

The div will be just big enough to contain all that text. Set a border on the div to make it easy to see:

#foo
{
 border: solid 1px red;

Now set the width to 25%:

#foo
{
 border: solid 1px red;
 width: 25%;
}

The div is now 25% of its container, but the height expands to contain the content. If you now set a height that is smaller than the content (say 20px), the div now has a fixed height, but the cotnent doesn't fit, so it overflows (except in IE6, where the div actually expands to fit the content). The CSS overflow property defines how that overflow happens, and yes, if the content is too large then you get scroll bars.

Setting borders on elements is a really good way of seeing where elements are. The IE Developer Toolbar (and FireBug) have options to automatically show borders on elements.

mlov83
Asp.Net User
Re: Master Sheets with Stylesheets Question?2/7/2008 2:42:05 PM

0/0

Brilliant ill try it out tonight I wanted to have a fixed look for my master page thats why i put a fixed heigth on my left column. I wanted to have menus  on a div with a set height and next to it a content div, that will automatically expand  along with with the left column, depending on  how much more content is withing the div. Thanks for all the Tips I think my answer is definitely the overflow feature.

Thank you much!

8 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Beginning ASP.NET 2.0 Authors: Chris Hart, John Kauffman, Chris Ullman, David Sussman, Pages: 759, Published: 2005
Visual Web Developer 2005 Express Edition For Dummies Authors: Alan Simpson, Pages: 358, Published: 2005
Pro ASP.NET 2.0 in C# 2005 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1255, Published: 2005
Pro ASP.NET 3.5 in C# 2008 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1498, Published: 2007
Pro ASP.NET 2.0 in VB 2005: From Professional to Expert Authors: Laurence Moroney, Matthew MacDonald, Pages: 1253, Published: 2006
Cascading Style Sheets Complete Authors: David D. Busch, J. W. Olsen, Pages: 424, Published: 1998
Dreamweaver CS3 Bible: Master Every Aspect of Dreamweaver - Work with CSS, Text, Images, And Links - Incorporate Flash Movies and Other Media Authors: Joseph W. Lowery, Pages: 1112, Published: 2007
Pro ASP.NET 2.0 in C# 2005: Create Next-generation Web Applications with the Latest Version of Microsoft's Revolutionary Technology Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1426, Published: 2006
Webmaster in a Nutshell: A Desktop Quick Reference Authors: Stephen Spainhour, Robert Eckstein, Pages: 561, Published: 2003
Web Style Guide Basic Design Principles for Creating Web Sites Authors: unknown, Pages: 0, Published: -1

Web:
Complete CSS Guide - Cascading style sheets reference - Contents They are brought to you courtesy of Style Master CSS Editor and Westciv's standards based web .... Validate your style sheets · Made with Style Master ...
Crucial Web Hosting » Blog » Master Stylesheet: The Most Useful ... Question: Why does my browser ask me if I want to display ‘active content’ ..... But the whole idea with master style sheets is to make a style sheet that ...
RichInStyle.com - Style sheet master class: part 1 - writing ... since this tends to complicate style sheets. Here's some examples: ..... first of RichInStyle.com's master classes, chances are that your style sheet will ...
Master Page prevents using style sheets? Master Page prevents using style sheets? ... that was contained in the master page. So my questions are: ...
Dr. Dobb's Software tools and techniques for global software development. Dr. Dobb's features articles, source code, blogs,forums,video tutorials, and audio podcasts , ...
Master the basics of Cascading Style Sheets, from Prentice Hall ... In this sample chapter from Web Technologies: A Computer Science Perspective, master the basics of Cascading Style Sheets (CSS), a style sheet technolo.
The World Wide Web Consortium - Master Class Cascading Style ... Master Class Cascading Style Sheets in Amsterdam. Cascading Style Sheets (CSS) is a ... W3C related events in the Benelux · Frequently asked questions ...
TYPOGRAPHY: Cascading style sheets Cascading Style Sheets offer Web designers two key advantages in managing ... except that with CSS you can set up one master style sheet that will control ...
Linking Style Sheets - CSS Linking Style Sheets. Get answers to your questions in our CSS forum. ... I have a master style sheet and if an alternate style sheet ...
Lesson 6: Style Sheets and Master Pages using Visual Basic In this lesson, you will begin to learn how Style sheets and Master Pages can be used to maintain consistent appearance for your Web pages. ...

Videos:
XML11: An Abstract Windowing Protocol Google TechTalks June 1, 2006 Arno Puder Arno Puder received his masters and Ph.D. in computer science and is currently working as an Assistant Prof...




Search This Site:










two level tab menu

new design for css friendly login control

problem with skin files

css adapter - adapterenabled property doesn't work completely

tweaking the html layouts

how can i load this in vs 2005?

gridview caption

browser definition files - what am i doing wrong?

problems with horizontal orientation

gridview <emptydatatemplate>

treeview with three state chechbox

turn of css adapter for selected controls

changing style of gridview row in code-behind on a css-friendly gridview

installation error

custom rendering of wizard control

cleint-side support

<tr> mouseover in gridview

problem centering menu control using adpaters

install - update - css control adapters

problem with css adapters and iis

when menuitem.navigateurl is not set the menuitemclick event isn't fired!

how to create sub menu related to main menu with asp:menu

stylesheet question

gridview adapter with pagertemplate broken

css friendly adapters (beta3) can't find css file

[beta3] treeview bug with enhanced theme ?

css adapters ok on sharepoint desinger?

beta 3 error message on detailsviewadapter

gridviewadapter beta 3.0 with added support for cssclass, clientid, headerstyle-cssclass, row.cssclass, row.attributes

css adapter & tables with content query web part?

  Privacy | Contact Us
All Times Are GMT