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/13/2007 7:04:02 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 3 Views: 14 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
4 Items, 1 Pages 1 |< << Go >> >|
wyx2000
Asp.Net User
What is the easiest way to add a style to Body? I want it inline, not in css files.8/13/2007 7:04:02 PM

0/0

thanks

augustwind
Asp.Net User
Re: What is the easiest way to add a style to Body? I want it inline, not in css files.8/13/2007 7:26:48 PM

0/0

What exactly are you asking?

Do you want to do this dynamically?

I mean, if not - you just create an inline StyleSheet section in your HTML


David Wier
MVP/MCP/ASPInsider
ASPNet101.com - where to look first!
iWrite Pro - doc/rtft to HTML/One Click PDF & much more
wyx2000
Asp.Net User
Re: What is the easiest way to add a style to Body? I want it inline, not in css files.8/13/2007 8:19:25 PM

0/0

Sorry.

Right, I want to do it dynamically.
I used to put it into a css file under theme, like
body{
background:#193b94 url(bg.jpg) repeat-x;
}

but I use that css file on other place where can not have background, so I need write the background in code dynamically.

I am just not sure if I should output text like
<style type="text/css">
body{
background:#193b94 url(bg.jpg) repeat-x;
}
</style>

or I can set it on body tag directly, or output

body{
background:#193b94 url(bg.jpg) repeat-x;
}

directly in some way

Amanda Wang - M
Asp.Net User
Re: What is the easiest way to add a style to Body? I want it inline, not in css files.8/15/2007 10:06:52 AM

0/0

Hi,

The style element doesn't directly map to any built in ASP.net controls, but you can use an HtmlGenericControl instead, and set the tag name, attributes and content manually, like so...

 HtmlGenericControl styles = new HtmlGenericControl("style");
        styles.Attributes.Add("type", "text/css");
        styles.InnerText = "body{background-color:Red}";

        this.Header.Controls.Add(styles);
 Hope it helps.
Please remember to mark the replies as answers if they help and unmark them if they provide no help.


Yours sincerely,
Amanda Wang
Microsoft Online Community Support
4 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
How to Do Everything with HTML & XHTML Authors: James H. Pence, Pages: 416, Published: 2003
Great Web Typography Authors: Wendy Peck, Pages: 316, Published: 2003
Beginning ASP.NET 3.5 in C# 2008: From Novice to Professional Authors: Matthew MacDonald, Pages: 954, Published: 2007
Beginning Dreamweaver MX 2004 Authors: Charles E. Brown, Imar Spaanjaars, Todd Marks, Pages: 792, Published: 2004
Creative Web Design: Tips and Tricks Step by Step Authors: Michael Baumgardt, Pages: 170, Published: 1998
Foundations of Microsoft Expression Web: The Basics and Beyond Authors: Cheryl D. Wise, Pages: 370, Published: 2007
Professional Rich Internet Applications: AJAX and Beyond Authors: Dana Moore, Raymond Budd, Edward Benson, Pages: 565, Published: 2007
Macromedia Dreamweaver MX Advanced for Windows and Macintosh: Visual Quickpro Guide Authors: J. Tarin Towers, Abie Hadjitarkhani, Sasha Magee, Pages: 490, Published: 2002

Web:
Using basic CSS in Web pages Nov 13, 2005 ... The CSS file contains all of the style declarations that we’ll be ... the basis for this tutorial since it’s the easiest way to learn CSS. ...
Style Sheets in HTML documents For example, the following short CSS style sheet (stored in the file .... by our style

This one is not affected by our style

...
Beginners guide to CSS - cascading style sheets The easiest way to understand CSS is to see it in action. Create a text file ... In the text file, add these instructions only:. BODY { font-family: Arial; ...
Separation of Style, Structure & Content CSS files should NOT contain anything but the most insignificant of ..... I don' t want to use inline styles either, that would be my last ...
A Look at the N|vu WYSIWYG Editor Sadly I could not find any way to change the page encoding except ... In this case, the program should add these inline styles to the css file that I ...
Dynamically setting a MasterPage's tag style Wouldn't you be better off setting the body Style css in a Stylesheet instead of inline on the tag, and then just arranging to load the ...
WordPress › Support » CSS file and page templates When I want to target the

tag to make the text red with CSS, I add p { color : red; ... They explain things in the easiest way and they're free. ...
Constants in CSS - several ways how to simulate As CSS does not allow for that, we need to find a way around the problem. ... All we need is to add one ID to the BODY of the document - something that ...
Cascading Style Sheets - CSS One of the basic best practices for CSS is to not use inline styles. ... If you want to divide sections of your HTML, one way to do it is with the HR tag. ...
How to Create Great HTML Emails with CSS - WebReference.com- Dec 6, 2006 ... The most reliable way to include CSS in an HTML email is to use inline styles. They aren't pretty, but few email clients ignore them. ...

Videos:
GeoServer and Architectures of Participation for Geospatial Information Google TechTalks August 23, 2006 Chris Holmes ABSTRACT This talk will introduce GeoServer, an open source server to publish and edit geospatial dat...





Search This Site:










attach a javascript file

help needed with a menu

nested masterpages

contentpage on master grows beyond bounds

how do i incorporate a web design using frames in my master page?

ordering stylesheets with themes and masterpages.

usercontrol inside contentplaceholder

document title

css style not being applied

changing background image of master page according to content page

master page question

how do i access public property in nested masterpage?

difficult to control the style of the menu in asp.net 2.0

adding a header on every content page

asp.net menu performance issues

navigation features

sending back values to opener pages with master pages

activating the view from which the treeview node is clicked in a multiview menu

how do i set master.page image button

old master page replaced with a new one!

how to use tab control?

how to load a skin file from a subfolder?

dropdown vertical navigation menu ( with animation? )

masterpagefile in web.config

templates into db

web site path/flow

design time styles not rendering

making menu nodes visible to anonymous users only

not a wiz with the wizard

how do i reference a gridview column in a .skin file?

  Privacy | Contact Us
All Times Are GMT