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: 8/30/2007 7:44:19 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 7 Views: 29 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
8 Items, 1 Pages 1 |< << Go >> >|
jpete17
Asp.Net User
css Hierarchy8/30/2007 7:44:19 PM

0/0

i am using a template to desigen a website. it has a master css sheet with attributes for elements, classes, and ids. Some if not many of the attributes seem to overlap with different rules set. My question is what page gets what rules? i.e. if a page inherits from the master page does it then also inherit all the css rules as well or can you change these for the page only? thanks in advance
Mikesdotnetting
Asp.Net User
Re: css Hierarchy8/30/2007 8:25:22 PM

0/0

Since the page and the Masterpage are effectively merged at runtime and emitted as one html entity, they are both affected by all the CSS that appears in each one.

Inline styles override those declared in a <style> block, which in turn override those in any external style sheet.  I would advise setting all your styles in a separate style sheet, so the kind of problem you are encountering is minimised.  


Regards Mike

8 out of 10 questions have already been asked. Their answers can be found using Google. Go on, try it.

If you prefer code samples or tutorials in another language, translate it for free at www.codechanger.com
jpete17
Asp.Net User
Re: css Hierarchy8/31/2007 7:16:05 PM

0/0

 thank you, now for a follow up...

on my master page i can click on an area i want to change through the style sheet.

it shows <body> <div#wrapper> <div#header>

does the # indicate an element id or an element class? Where should i change the attributes within the style sheet??

thanks again 

 

 

Mikesdotnetting
Asp.Net User
Re: css Hierarchy8/31/2007 7:24:01 PM

0/0

<div id="wrapper"> would appear in the aspx.  To set the style for that, you woulddo something like this:

#wrapper
{
    font-family: Arial, Helvetica, sans-serif;
}

For class selectors eg<div class="myclass">, the declaration in the style sheet would look like this:

.myclass
{
    font-family: Arial, Helvetica, sans-serif;
}

http://msconline.maconstate.edu/tutorials/XHTML/default.htm
 


Regards Mike

8 out of 10 questions have already been asked. Their answers can be found using Google. Go on, try it.

If you prefer code samples or tutorials in another language, translate it for free at www.codechanger.com
jpete17
Asp.Net User
Re: css Hierarchy8/31/2007 8:16:42 PM

0/0

thanks so to clarify, would the rules in
override the rules in is they confilicted? Or does header inherit all rules set from wrapper?
Mikesdotnetting
Asp.Net User
Re: css Hierarchy8/31/2007 8:56:56 PM

0/0

Example:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
#wrapper{font-family:arial}
</style>
</head>

<body>
<p>Some text</p>
<div id="wrapper">
<div id="header">some header text</div>
</div>
<p>Other text</p>
</body>
</html>

"Some text" and "Other text" appear as the default font (Times New Roman, in my case). #header does not have a style set, but inherits Arial from the wrapper.

What I normally do is something like this (from my site):

body
{
font-family: Georgia, "Times New Roman", Times, serif;
color: #5a5a5a;
font-size: 76%;
padding:0;
margin:0;
}

That stes the rules for the whole body.  Then I set up new rules for each section or div.

If you haven't already, get the FireFox browser.  When you see a site that you think has been styled nicely, hit Ctrl + Shift + C.  Up pops all the css that's used on that page.  Borrow it and apply it to a page of your own.  Then change bits one by one to see what effect it has.  That's the best way to learn.
 


Regards Mike

8 out of 10 questions have already been asked. Their answers can be found using Google. Go on, try it.

If you prefer code samples or tutorials in another language, translate it for free at www.codechanger.com
jpete17
Asp.Net User
Re: css Hierarchy9/1/2007 1:23:29 AM

0/0

never knew firefox allowed you to do that.  thanks again you have helped further my understanding concerning this topic

Mikesdotnetting
Asp.Net User
Re: css Hierarchy9/1/2007 6:57:25 PM

0/0

jpete17:

never knew firefox allowed you to do that.

 

Ah.  I should have mentioned that you need to install the Web Developer addon to do this.  Another useful addon is FireBug.

https://addons.mozilla.org/en-US/firefox/browse/type:1/cat:4 


Regards Mike

8 out of 10 questions have already been asked. Their answers can be found using Google. Go on, try it.

If you prefer code samples or tutorials in another language, translate it for free at www.codechanger.com
8 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Beginning CSS Web Development: From Novice to Professional Authors: Simon Collison, Pages: 413, Published: 2006
Taiwan's Security in the Post-Deng Xiaoping Era Authors: Martin L. Lasater, Peter Kien-hong Yu, Pages: 356, Published: 2000
Special Edition Using XHTML: special edition Authors: Molly E. Holzschlag, Pages: 958, Published: 2001
Learning XML: [creating self-describing data] Authors: Erik T. Ray, Pages: 400, Published: 2003
The Development of Complex Sentences: A Case Study of Finnish Authors: Anneli Lieko, Pages: 339, Published: 1992
Dreamweaver CS3 For Dummies Authors: Janine Warner, Pages: 434, Published: 2007
Stylin' with CSS: A Designer's Guide Authors: Charles Wyke-Smith, Pages: 275, Published: 2005
Pro Ajax and the .NET 2.0 Platform Authors: Daniel Woolston, Pages: 463, Published: 2006
Beginning DotNetNuke Skinning and Design: Skinning and Desing Authors: Andrew Hay, Nina Meiers, Shaun Walker, Pages: 432, Published: 2007
Sams Teach Yourself XML in 24 Hours Authors: Michael Morrison, Charles Ashbacher, Pages: 485, Published: 2002

Web:
Hierarchy in styles - CSS Hierarchy in styles. Get answers to your questions in our CSS forum.
Cascading Style Sheets / Syntax - webreference.com Conflict resolution is an integral part of the CSS spec, and is based on each ... You can see this version of CSS has incorporated frames neatly into style ...
CSS Hierarchy. A common mistake I find quite often is the hierarchy of information on websites. Its common sense to put the most important information or the most accessed ...
DotNetNuke CSS hierarchy Having a better understanding of how things work, I think we can now talk about the DotNetNuke CSS hierarchy. With the term "CSS hierarchy" we mean which ...
Understanding CSS Hierarchy | NZ Web Hosting Understanding CSS Hierarchy. Keywords:. CSS. 09 Jul 2007 ... We have spoken about some basic rules about hierarchy within CSS, but rules ore meant to be ...
Web Tutorials:CSS:What is CSS A CSS Hierarchy [Up]. It can be defined in four levels:. The browser default;; External style sheets;; Internal styles, in the header of the page; ...
CSS Tutorials: CSS Hierarchy Oct 14, 2003 ... CSS Hierarchy. New tutorial added. A look into how to structure your xhtml when a stylesheet can't be accessed. Posted on October 14, ...
DevPapers - article CSS Hierarchy 95% of your audience will see number 1, a CSS stylesheet usually controls your frontend hierarchy. This means no matter what order your content is in, ...
How to Draw a Flowchart for CSS Hierarchy | eHow.com How to Draw a Flowchart for CSS Hierarchy. As CSS (cascading style sheets) takes the place of repetitive HTML tags in modern website programming, ...
CSS / Javascript Hierarchy Sep 21, 2005 ... CSS / Javascript Hierarchy - Steve Clay, 21st September 2005 19:21. CSS / Javascript Hierarchy - Scott Glasgow, 21st September 2005 19:36 ...

Videos:
FreelineReport 05.09.08 http://www.freelinerorport.com Monster.com founder Jeff Taylor is launching a new web site in June called Tributes.com, which he hopes will become t...
Literate functional testing Google London Test Automation Conference (LTAC) Google Tech Talks September 7th, 2006 Presenters: Robert Chatley and Tom White
Affiliate Summit 2006 East -- Straight Talk on Search Engine Optimization Brief presentation on Search Engine Optimization with a heavy focus on Q&A. A very open, honest and straight to the point discussion about search eng...




Search This Site:










banner ad space & master pages

2 quesions/issues

bug with masterpages and usercontrol outputcache shared=false?

where is header and side template insert table ??

how to override <menu> default output & have a css stylesheet control all rendering

menu click event handling problem on master page...

navigation menu question.

2.0 menu control not working in beta 2

content area problem

menu control does not appear the same in ie and firefox

position a panel to the right

treeview - selectednodechanged event with showcheckbox activated.

2 master pages within one site not nested

descending into folders

style sheet not attaching to forms or pages

treenode not returning parent

html size of menu

master pages, styles and ids

asp menu control

how many content place holders?

export template

masterpages; adding content to head and strict xhtml

stylesheet won't load for the signon form

menu item with image

problems with css - site looks different in ie and firefox

remove arrow from menu

master pages and page base classes

menu control in master pages

master page returns null

how come this doesn't work? label on master page will is not accessible?

  Privacy | Contact Us
All Times Are GMT