SlideShare une entreprise Scribd logo
1  sur  22
•   Style Types
•   Style Builder
•   The CSS Properties Window
•   Creating a StyleSheet
•   The CSS Outline Window
•   The Apply Style Window
•   Themes, Stylesheet Themes
•   How to Create and Apply Themes
•   Skin File, Named Skin
•   Master Pages
•   Content Pages
•   Master Page with Multiple Content Regions
•   Advanced Master Pages
•   Style Based Layouts
Styles gives you a wide range of consistent formatting
properties that you can apply to any HTML element.

They allow you to add borders, set font details, change
colors, add margin space and padding, and so on.
Web pages can use styles in three different ways:

• Inline style
• Internal style sheet
• Internal style sheet
Visual Studio provides an indispensable style
builder that lets you create styles by picking
and choosing your style preferences in a
dedicated dialog box.

Click inside a control on a web page
choose Format ➤ New Style from the menu.
This opens the New Style dialog box In the
Selector box at the top of the window, choose
“(inline style)” to specify that you’re creating
your style directly in the HTML markup
Once you’ve created a style, you have two easy options
for modifying it in Visual Studio.

To show the CSS Properties window, open a web page
in Visual Studio and choose View ➤ CSS Properties.

The CSS Properties window provides an exhaustive list
of all the formatting properties you can use in a style.
This list is grouped into categories, and the properties in
each category are sorted alphabetically. The ones that
are currently set are displayed in bold.
To create a style sheet in Visual Studio, choose Website
➤ Add New Item from the Visual Studio menu. Then,
pick the Style Sheet template, specify a file name (like
StyleSheet.css), and click Add.

In a style sheet, you define several styles (also known
as rules). You can then use these rules to format
ordinary HTML and ASP.NET controls.

Each rule defines a collection of formatting presets that
determines how a single ingredient in your web page
should be formatted.
Visual Studio includes a CSS Outline window that shows
you an overview of the rules in your style sheet.

When you’re editing a style sheet, you can show the
CSS Outline window by choosing View ➤ Other
Windows ➤ Document Outline.

Rule names are technically known as selectors, because
they identify the parts of an HTML document that should
be selected for formatting.
To use a rule in a web page, you first need to link the
page to the appropriate style sheet. You do this by
adding a <link> element in the <head> section of your
page. The <link> element references the file with
the styles you want to use.
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>...</title>
<link href="StyleSheet.css" rel="stylesheet"
type="text/css" />
</head>
<body>
...
</body>
</html>
The problem is that CSS rules are limited to a
fixed set of style attributes.

For example, the CheckBoxList control includes
properties that control how it organizes items into
rows and columns. Although these properties
affect the visual appearance of the control, they’re
outside the scope of CSS

You might want to define part of the behavior of
the control along with the formatting. For
example, you might want to standardize the
selection mode of a Calendar control or the
wrapping in a TextBox. This obviously isn’t
possible through CSS
Like CSS, themes allow you to define a set of
style details that you can apply to controls in
multiple pages. However, unlike CSS, themes
aren’t implemented by the browser. Instead,
ASP.NET processes your themes when it creates
the page.

Styles are particularly useful when you want to
apply the same formatting to web controls and
ordinary HTML elements. Themes are
indispensable when you want to configure control
properties that can’t be tailored with CSS
• To use a theme in a web application, you need to
  create a folder that defines it.

• This folder needs to be placed in a folder named
  App_Themes, which must be placed inside the
  top-level directory for your web application.

• An application can contain definitions for multiple
  themes, as long as each theme is in a separate
  folder.

• Only one theme can be active on a given page at
  a time
To actually make your theme accomplish anything,
you need to create at least one skin file in the
theme folder. A skin file is a text file with the .skin
extension.

A skin file is essentially a list of control tags with their
properties that you want to standardize.

<asp:ListBox runat="server" ForeColor="White"
BackColor="Orange"/>
ASP.NET also supports global themes.

These are themes you place in the folder :
c:Inetpubwwwrootaspnet_clientsystem_webv2.0.50727Themes

However, it’s recommended that you use local themes,
even if you want to create more than one website that has
the same theme.

If you have a local theme with the same name as a global
theme, the local theme takes precedence, and the global
theme is ignored.

The themes are not merged together.
To create theme for your project, select Website ➤ Add New Item, and
choose Skin File. Visual Studio will warn you that skin files need to be
placed in a subfolder of the App_Themes folder. If you choose Yes, Visual
Studio will create a folder with the same name as your skin file.

Copy and paste control tags from other web pages.
<asp:ListBox runat="server" ForeColor="White“ BackColor="Orange"/>
<asp:TextBox runat="server" ForeColor="White" BackColor="Orange"/>
<asp:Button runat="server" ForeColor="White" BackColor="Orange"/>

To apply the theme in a web page, you need to set the Theme attribute of
the Page directive to the folder name for your theme. (ASP.NET will
automatically scan all the skin files in that theme.)

<%@ Page Language="C#" AutoEventWireup="true" ...
Theme="FunkyTheme" %>
When you apply a theme to a page, ASP.NET considers each
control on your web page and checks your skin files to see
whether they define any properties for that control. If ASP.NET
finds a matching tag in the skin file, the information from the
skin file overrides the current properties of the control.

However, in some cases you might want to change this
behavior so that your controls can fine-tune a theme by
specifically overriding certain control details.

To make this change, just use the StyleSheetTheme attribute
instead of the Theme attribute in the Page directive.

<%@ Page Language="C#" AutoEventWireup="true" ...
StyleSheetTheme="FunkyTheme" %>
By configuring the <pages> element in the web.config
file for your application, as shown here:

<configuration>
<system.web>
<pages theme="FunkyTheme">
//or <pages styleSheetTheme= "FunkyTheme">
...
</pages>
</system.web>
</configuration>
You might have several types of text boxes that are
distinguished based on where they’re used or what type of
data they contain i.e. you may want to create more than one
theme for the same control.

To get around this problem, you need to create a named skin
by supplying a SkinID attribute.

<asp:Button runat="server" ForeColor="White“ BackColor=
"DarkOrange“ Font-Bold="True" SkinID="Dramatic"/>

To use a named skin, you need to set the SkinID of the
control on your web page to match

<asp:Button ID="Button1" runat="server" ...
SkinID="Dramatic" />
If you want a navigation bar on every web page not only do
you need to copy the same user interface markup to each
page, you also need to make sure it ends up in the same
place.

And even if you copy your markup on all pages, you’re still
left with an extremely brittle design. If you decide to update
your navigation bar or change its position later, you’ll need
to modify every web page to apply the same change.

A better choice is to use ASP.NET’s master pages feature,
which allows you to define page templates and reuse them
across your website.
Master pages are similar to ordinary ASP.NET pages. Like
ordinary pages, master pages are text files that can contain
HTML, web controls, and code.

However, master pages have a different file extension
(.master instead of .aspx), and they can’t be viewed directly
by a browser. Instead, master pages must be used by other
pages, which are known as content pages.

Essentially, the master page defines the page structure and
the common ingredients. The content pages adopt this
structure and just fill it with the appropriate content.
To create a master page in Visual Studio, select Website ➤
Add New Item from the menu.

Select Master Page, and click Add. This creates a blank page
that includes two ContentPlaceHolder controls. One is
defined in the <head> section. The second, more important
ContentPlaceHolder is defined in the <body> section, and
represents the displayed content of the page.

The ContentPlaceHolder is the portion of the Master page
that a content page can change.
For the most part, HTML uses a flow-based layout. That means as
more content is added, the page is reorganized and other content is
bumped out of the way. This layout can make it difficult to get the
result you want with master pages.

Although you can’t avoid this problem completely, there are two
options to help you control the layout of a web page:

HTML tables: Using an HTML table in your master page, you can
break a portion of your page into columns and rows. You can then
add a ContentPlaceHolder in a single cell, ensuring that the other
content is aligned more or less the way you want.

CSS positioning: Using CSS styles, you can divide your content into
columns or regions, each of which is held in a separate <div>
element. You then place a single ContentPlaceHolder in each <div>.

Contenu connexe

Tendances

Vskills certified html5 developer Notes
Vskills certified html5 developer NotesVskills certified html5 developer Notes
Vskills certified html5 developer NotesVskills
 
Custome page template
Custome page templateCustome page template
Custome page templateLucky Ali
 
Unit d adobe dreamweaver cs6
Unit d adobe dreamweaver cs6Unit d adobe dreamweaver cs6
Unit d adobe dreamweaver cs6Krista Lawrence
 
Unit h adobe dreamweaver cs6
Unit h adobe dreamweaver cs6Unit h adobe dreamweaver cs6
Unit h adobe dreamweaver cs6Krista Lawrence
 
ASP.NET 06 - Customizing Your Sites Appearance
ASP.NET 06 - Customizing Your Sites AppearanceASP.NET 06 - Customizing Your Sites Appearance
ASP.NET 06 - Customizing Your Sites AppearanceRandy Connolly
 
Unit g adobe dreamweaver cs6
Unit g adobe dreamweaver cs6Unit g adobe dreamweaver cs6
Unit g adobe dreamweaver cs6Krista Lawrence
 
Blooming SharePoint Design
Blooming SharePoint DesignBlooming SharePoint Design
Blooming SharePoint DesignKathy Hughes
 
Unit f adobe dreamweaver cs6
Unit f adobe dreamweaver cs6Unit f adobe dreamweaver cs6
Unit f adobe dreamweaver cs6Krista Lawrence
 
Transform SharePoint List Forms with HTML and CSS
Transform SharePoint List Forms with HTML and CSSTransform SharePoint List Forms with HTML and CSS
Transform SharePoint List Forms with HTML and CSSJohn Calvert
 

Tendances (16)

Vskills certified html5 developer Notes
Vskills certified html5 developer NotesVskills certified html5 developer Notes
Vskills certified html5 developer Notes
 
Html introduction
Html introductionHtml introduction
Html introduction
 
ASP.NET Lecture 3
ASP.NET Lecture 3ASP.NET Lecture 3
ASP.NET Lecture 3
 
Custome page template
Custome page templateCustome page template
Custome page template
 
TemplateTutorial
TemplateTutorialTemplateTutorial
TemplateTutorial
 
Unit d adobe dreamweaver cs6
Unit d adobe dreamweaver cs6Unit d adobe dreamweaver cs6
Unit d adobe dreamweaver cs6
 
HTML CSS | Computer Science
HTML CSS | Computer ScienceHTML CSS | Computer Science
HTML CSS | Computer Science
 
To create a web service
To create a web serviceTo create a web service
To create a web service
 
Unit h adobe dreamweaver cs6
Unit h adobe dreamweaver cs6Unit h adobe dreamweaver cs6
Unit h adobe dreamweaver cs6
 
ASP.NET 06 - Customizing Your Sites Appearance
ASP.NET 06 - Customizing Your Sites AppearanceASP.NET 06 - Customizing Your Sites Appearance
ASP.NET 06 - Customizing Your Sites Appearance
 
Unit g adobe dreamweaver cs6
Unit g adobe dreamweaver cs6Unit g adobe dreamweaver cs6
Unit g adobe dreamweaver cs6
 
Sharepoint
SharepointSharepoint
Sharepoint
 
Blooming SharePoint Design
Blooming SharePoint DesignBlooming SharePoint Design
Blooming SharePoint Design
 
Unit f adobe dreamweaver cs6
Unit f adobe dreamweaver cs6Unit f adobe dreamweaver cs6
Unit f adobe dreamweaver cs6
 
Transform SharePoint List Forms with HTML and CSS
Transform SharePoint List Forms with HTML and CSSTransform SharePoint List Forms with HTML and CSS
Transform SharePoint List Forms with HTML and CSS
 
Dreamweaver
DreamweaverDreamweaver
Dreamweaver
 

En vedette (20)

Chapter 19
Chapter 19Chapter 19
Chapter 19
 
CSS
CSSCSS
CSS
 
Chapter 25
Chapter 25Chapter 25
Chapter 25
 
Intro To ECAT
Intro To ECATIntro To ECAT
Intro To ECAT
 
CSS3 notes
CSS3 notesCSS3 notes
CSS3 notes
 
HTML5 &CSS: Chapter 08
HTML5 &CSS: Chapter 08HTML5 &CSS: Chapter 08
HTML5 &CSS: Chapter 08
 
Html and CSS: Chapter 02
Html and CSS: Chapter 02Html and CSS: Chapter 02
Html and CSS: Chapter 02
 
HTML & CSS: Chapter 03
HTML & CSS: Chapter 03HTML & CSS: Chapter 03
HTML & CSS: Chapter 03
 
HTML: Chapter 01
HTML: Chapter 01HTML: Chapter 01
HTML: Chapter 01
 
HTML & CSS: Chapter 07
HTML & CSS: Chapter 07HTML & CSS: Chapter 07
HTML & CSS: Chapter 07
 
HTML & CSS: Chapter 06
HTML & CSS: Chapter 06HTML & CSS: Chapter 06
HTML & CSS: Chapter 06
 
CSS - Basics
CSS - BasicsCSS - Basics
CSS - Basics
 
Unit 6, Lesson 3 - Vectors
Unit 6, Lesson 3 - VectorsUnit 6, Lesson 3 - Vectors
Unit 6, Lesson 3 - Vectors
 
HTML & CSS: Chapter 04
HTML & CSS: Chapter 04HTML & CSS: Chapter 04
HTML & CSS: Chapter 04
 
Bread board
Bread boardBread board
Bread board
 
Breadboard
BreadboardBreadboard
Breadboard
 
Basic css
Basic cssBasic css
Basic css
 
Web Engineering - Basic CSS Properties
Web Engineering - Basic CSS PropertiesWeb Engineering - Basic CSS Properties
Web Engineering - Basic CSS Properties
 
Vernier caliper
Vernier caliperVernier caliper
Vernier caliper
 
Spline Interpolation
Spline InterpolationSpline Interpolation
Spline Interpolation
 

Similaire à Chapter 12

Lesson 2 cs5
Lesson 2   cs5Lesson 2   cs5
Lesson 2 cs5dtelepos
 
BP304 - Blog It Up, Baby! Extending the new IBM Lotus Domino Blog Template
BP304 - Blog It Up, Baby! Extending the new IBM Lotus Domino Blog TemplateBP304 - Blog It Up, Baby! Extending the new IBM Lotus Domino Blog Template
BP304 - Blog It Up, Baby! Extending the new IBM Lotus Domino Blog TemplateSean Burgess
 
Intermediate Web Design.doc
Intermediate Web Design.docIntermediate Web Design.doc
Intermediate Web Design.docbutest
 
Customizing the Appearance and HTML Output of Visualforce Pages
Customizing the Appearance and HTML Output of VisualforcePages Customizing the Appearance and HTML Output of VisualforcePages
Customizing the Appearance and HTML Output of Visualforce Pages Mohammed Safwat Abu Kwaik
 
Using Wordpress with Reclaim Hosting
Using Wordpress with Reclaim HostingUsing Wordpress with Reclaim Hosting
Using Wordpress with Reclaim HostingCindy Royal
 
WordPress HTML, CSS & Child Themes
WordPress HTML, CSS & Child ThemesWordPress HTML, CSS & Child Themes
WordPress HTML, CSS & Child ThemesMichelle Ames
 
04 asp.net session05
04 asp.net session0504 asp.net session05
04 asp.net session05Vivek chan
 
Wordpress workflow for an agency world
Wordpress workflow for an agency worldWordpress workflow for an agency world
Wordpress workflow for an agency worldChris Lowe
 
Css Founder.com | Cssfounder se
Css Founder.com | Cssfounder seCss Founder.com | Cssfounder se
Css Founder.com | Cssfounder seCss Founder
 
SDP_-_Module_4.ppt
SDP_-_Module_4.pptSDP_-_Module_4.ppt
SDP_-_Module_4.pptssuser568d77
 
Blog It Up, Baby! Extending the new IBM Lotus Domino Blog Template
Blog It Up, Baby! Extending the new IBM Lotus Domino Blog TemplateBlog It Up, Baby! Extending the new IBM Lotus Domino Blog Template
Blog It Up, Baby! Extending the new IBM Lotus Domino Blog TemplateSean Burgess
 
Master pages
Master pagesMaster pages
Master pagesteach4uin
 
Aspnet master pages_tutorial_10_cs
Aspnet master pages_tutorial_10_csAspnet master pages_tutorial_10_cs
Aspnet master pages_tutorial_10_csVaibhav Chavan
 
Css introduction
Css introductionCss introduction
Css introductionSridhar P
 

Similaire à Chapter 12 (20)

Lesson 2 cs5
Lesson 2   cs5Lesson 2   cs5
Lesson 2 cs5
 
Themes
ThemesThemes
Themes
 
Walkthrough asp.net
Walkthrough asp.netWalkthrough asp.net
Walkthrough asp.net
 
BP304 - Blog It Up, Baby! Extending the new IBM Lotus Domino Blog Template
BP304 - Blog It Up, Baby! Extending the new IBM Lotus Domino Blog TemplateBP304 - Blog It Up, Baby! Extending the new IBM Lotus Domino Blog Template
BP304 - Blog It Up, Baby! Extending the new IBM Lotus Domino Blog Template
 
Intermediate Web Design.doc
Intermediate Web Design.docIntermediate Web Design.doc
Intermediate Web Design.doc
 
Customizing the Appearance and HTML Output of Visualforce Pages
Customizing the Appearance and HTML Output of VisualforcePages Customizing the Appearance and HTML Output of VisualforcePages
Customizing the Appearance and HTML Output of Visualforce Pages
 
Using Wordpress with Reclaim Hosting
Using Wordpress with Reclaim HostingUsing Wordpress with Reclaim Hosting
Using Wordpress with Reclaim Hosting
 
WordPress HTML, CSS & Child Themes
WordPress HTML, CSS & Child ThemesWordPress HTML, CSS & Child Themes
WordPress HTML, CSS & Child Themes
 
Using class suffixes
Using class suffixesUsing class suffixes
Using class suffixes
 
04 asp.net session05
04 asp.net session0504 asp.net session05
04 asp.net session05
 
Wordpress workflow for an agency world
Wordpress workflow for an agency worldWordpress workflow for an agency world
Wordpress workflow for an agency world
 
Master pages
Master pagesMaster pages
Master pages
 
Css Founder.com | Cssfounder se
Css Founder.com | Cssfounder seCss Founder.com | Cssfounder se
Css Founder.com | Cssfounder se
 
Introduction to css
Introduction to cssIntroduction to css
Introduction to css
 
SDP_-_Module_4.ppt
SDP_-_Module_4.pptSDP_-_Module_4.ppt
SDP_-_Module_4.ppt
 
Blog It Up, Baby! Extending the new IBM Lotus Domino Blog Template
Blog It Up, Baby! Extending the new IBM Lotus Domino Blog TemplateBlog It Up, Baby! Extending the new IBM Lotus Domino Blog Template
Blog It Up, Baby! Extending the new IBM Lotus Domino Blog Template
 
Master pages
Master pagesMaster pages
Master pages
 
ARTICULOENINGLES
ARTICULOENINGLESARTICULOENINGLES
ARTICULOENINGLES
 
Aspnet master pages_tutorial_10_cs
Aspnet master pages_tutorial_10_csAspnet master pages_tutorial_10_cs
Aspnet master pages_tutorial_10_cs
 
Css introduction
Css introductionCss introduction
Css introduction
 

Plus de application developer (20)

Chapter 26
Chapter 26Chapter 26
Chapter 26
 
Chapter 23
Chapter 23Chapter 23
Chapter 23
 
Assignment
AssignmentAssignment
Assignment
 
Next step job board (Assignment)
Next step job board (Assignment)Next step job board (Assignment)
Next step job board (Assignment)
 
Chapter 18
Chapter 18Chapter 18
Chapter 18
 
Chapter 17
Chapter 17Chapter 17
Chapter 17
 
Chapter 16
Chapter 16Chapter 16
Chapter 16
 
Week 3 assignment
Week 3 assignmentWeek 3 assignment
Week 3 assignment
 
Chapter 15
Chapter 15Chapter 15
Chapter 15
 
Chapter 14
Chapter 14Chapter 14
Chapter 14
 
Chapter 13
Chapter 13Chapter 13
Chapter 13
 
Chapter 11
Chapter 11Chapter 11
Chapter 11
 
Chapter 10
Chapter 10Chapter 10
Chapter 10
 
C # test paper
C # test paperC # test paper
C # test paper
 
Chapter 9
Chapter 9Chapter 9
Chapter 9
 
Chapter 8 part2
Chapter 8   part2Chapter 8   part2
Chapter 8 part2
 
Chapter 8 part1
Chapter 8   part1Chapter 8   part1
Chapter 8 part1
 
Chapter 7
Chapter 7Chapter 7
Chapter 7
 
Chapter 6
Chapter 6Chapter 6
Chapter 6
 
Chapter 5
Chapter 5Chapter 5
Chapter 5
 

Dernier

Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 

Dernier (20)

Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 

Chapter 12

  • 1. Style Types • Style Builder • The CSS Properties Window • Creating a StyleSheet • The CSS Outline Window • The Apply Style Window • Themes, Stylesheet Themes • How to Create and Apply Themes • Skin File, Named Skin • Master Pages • Content Pages • Master Page with Multiple Content Regions • Advanced Master Pages • Style Based Layouts
  • 2. Styles gives you a wide range of consistent formatting properties that you can apply to any HTML element. They allow you to add borders, set font details, change colors, add margin space and padding, and so on. Web pages can use styles in three different ways: • Inline style • Internal style sheet • Internal style sheet
  • 3. Visual Studio provides an indispensable style builder that lets you create styles by picking and choosing your style preferences in a dedicated dialog box. Click inside a control on a web page choose Format ➤ New Style from the menu. This opens the New Style dialog box In the Selector box at the top of the window, choose “(inline style)” to specify that you’re creating your style directly in the HTML markup
  • 4.
  • 5. Once you’ve created a style, you have two easy options for modifying it in Visual Studio. To show the CSS Properties window, open a web page in Visual Studio and choose View ➤ CSS Properties. The CSS Properties window provides an exhaustive list of all the formatting properties you can use in a style. This list is grouped into categories, and the properties in each category are sorted alphabetically. The ones that are currently set are displayed in bold.
  • 6. To create a style sheet in Visual Studio, choose Website ➤ Add New Item from the Visual Studio menu. Then, pick the Style Sheet template, specify a file name (like StyleSheet.css), and click Add. In a style sheet, you define several styles (also known as rules). You can then use these rules to format ordinary HTML and ASP.NET controls. Each rule defines a collection of formatting presets that determines how a single ingredient in your web page should be formatted.
  • 7. Visual Studio includes a CSS Outline window that shows you an overview of the rules in your style sheet. When you’re editing a style sheet, you can show the CSS Outline window by choosing View ➤ Other Windows ➤ Document Outline. Rule names are technically known as selectors, because they identify the parts of an HTML document that should be selected for formatting.
  • 8. To use a rule in a web page, you first need to link the page to the appropriate style sheet. You do this by adding a <link> element in the <head> section of your page. The <link> element references the file with the styles you want to use. <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>...</title> <link href="StyleSheet.css" rel="stylesheet" type="text/css" /> </head> <body> ... </body> </html>
  • 9. The problem is that CSS rules are limited to a fixed set of style attributes. For example, the CheckBoxList control includes properties that control how it organizes items into rows and columns. Although these properties affect the visual appearance of the control, they’re outside the scope of CSS You might want to define part of the behavior of the control along with the formatting. For example, you might want to standardize the selection mode of a Calendar control or the wrapping in a TextBox. This obviously isn’t possible through CSS
  • 10. Like CSS, themes allow you to define a set of style details that you can apply to controls in multiple pages. However, unlike CSS, themes aren’t implemented by the browser. Instead, ASP.NET processes your themes when it creates the page. Styles are particularly useful when you want to apply the same formatting to web controls and ordinary HTML elements. Themes are indispensable when you want to configure control properties that can’t be tailored with CSS
  • 11. • To use a theme in a web application, you need to create a folder that defines it. • This folder needs to be placed in a folder named App_Themes, which must be placed inside the top-level directory for your web application. • An application can contain definitions for multiple themes, as long as each theme is in a separate folder. • Only one theme can be active on a given page at a time
  • 12.
  • 13. To actually make your theme accomplish anything, you need to create at least one skin file in the theme folder. A skin file is a text file with the .skin extension. A skin file is essentially a list of control tags with their properties that you want to standardize. <asp:ListBox runat="server" ForeColor="White" BackColor="Orange"/>
  • 14. ASP.NET also supports global themes. These are themes you place in the folder : c:Inetpubwwwrootaspnet_clientsystem_webv2.0.50727Themes However, it’s recommended that you use local themes, even if you want to create more than one website that has the same theme. If you have a local theme with the same name as a global theme, the local theme takes precedence, and the global theme is ignored. The themes are not merged together.
  • 15. To create theme for your project, select Website ➤ Add New Item, and choose Skin File. Visual Studio will warn you that skin files need to be placed in a subfolder of the App_Themes folder. If you choose Yes, Visual Studio will create a folder with the same name as your skin file. Copy and paste control tags from other web pages. <asp:ListBox runat="server" ForeColor="White“ BackColor="Orange"/> <asp:TextBox runat="server" ForeColor="White" BackColor="Orange"/> <asp:Button runat="server" ForeColor="White" BackColor="Orange"/> To apply the theme in a web page, you need to set the Theme attribute of the Page directive to the folder name for your theme. (ASP.NET will automatically scan all the skin files in that theme.) <%@ Page Language="C#" AutoEventWireup="true" ... Theme="FunkyTheme" %>
  • 16. When you apply a theme to a page, ASP.NET considers each control on your web page and checks your skin files to see whether they define any properties for that control. If ASP.NET finds a matching tag in the skin file, the information from the skin file overrides the current properties of the control. However, in some cases you might want to change this behavior so that your controls can fine-tune a theme by specifically overriding certain control details. To make this change, just use the StyleSheetTheme attribute instead of the Theme attribute in the Page directive. <%@ Page Language="C#" AutoEventWireup="true" ... StyleSheetTheme="FunkyTheme" %>
  • 17. By configuring the <pages> element in the web.config file for your application, as shown here: <configuration> <system.web> <pages theme="FunkyTheme"> //or <pages styleSheetTheme= "FunkyTheme"> ... </pages> </system.web> </configuration>
  • 18. You might have several types of text boxes that are distinguished based on where they’re used or what type of data they contain i.e. you may want to create more than one theme for the same control. To get around this problem, you need to create a named skin by supplying a SkinID attribute. <asp:Button runat="server" ForeColor="White“ BackColor= "DarkOrange“ Font-Bold="True" SkinID="Dramatic"/> To use a named skin, you need to set the SkinID of the control on your web page to match <asp:Button ID="Button1" runat="server" ... SkinID="Dramatic" />
  • 19. If you want a navigation bar on every web page not only do you need to copy the same user interface markup to each page, you also need to make sure it ends up in the same place. And even if you copy your markup on all pages, you’re still left with an extremely brittle design. If you decide to update your navigation bar or change its position later, you’ll need to modify every web page to apply the same change. A better choice is to use ASP.NET’s master pages feature, which allows you to define page templates and reuse them across your website.
  • 20. Master pages are similar to ordinary ASP.NET pages. Like ordinary pages, master pages are text files that can contain HTML, web controls, and code. However, master pages have a different file extension (.master instead of .aspx), and they can’t be viewed directly by a browser. Instead, master pages must be used by other pages, which are known as content pages. Essentially, the master page defines the page structure and the common ingredients. The content pages adopt this structure and just fill it with the appropriate content.
  • 21. To create a master page in Visual Studio, select Website ➤ Add New Item from the menu. Select Master Page, and click Add. This creates a blank page that includes two ContentPlaceHolder controls. One is defined in the <head> section. The second, more important ContentPlaceHolder is defined in the <body> section, and represents the displayed content of the page. The ContentPlaceHolder is the portion of the Master page that a content page can change.
  • 22. For the most part, HTML uses a flow-based layout. That means as more content is added, the page is reorganized and other content is bumped out of the way. This layout can make it difficult to get the result you want with master pages. Although you can’t avoid this problem completely, there are two options to help you control the layout of a web page: HTML tables: Using an HTML table in your master page, you can break a portion of your page into columns and rows. You can then add a ContentPlaceHolder in a single cell, ensuring that the other content is aligned more or less the way you want. CSS positioning: Using CSS styles, you can divide your content into columns or regions, each of which is held in a separate <div> element. You then place a single ContentPlaceHolder in each <div>.