Home > SAP administration / development Tips > SAP best practices > Cascading Style Sheets
SAP Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

SAP BEST PRACTICES

Cascading Style Sheets


Mario Perez, Alexander Hildenbrand, Bernd Matzke, and Peter Zencke
01.16.2002
Rating: -3.00- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


Excerpted from SAP R/3 on the Internet by Mario Perez, Alexander Hildenbrand, Bernd Matzke, and Peter Zencke, published by Addison Wesley.

The popularity of the Web has not only increased demands for interaction with the user, but also increased the desire to additional graphic design options in HTML. Microsoft and Netscape attempted to meet these demands by creating a number of proprietary enhancements to HTML. The enhancements, however, remained isolated islands. They did not lead to a standard and ran only in proprietary browsers. Web designers, of course, reacted with anger. To use the new options, designers had to double the work involved in creating a Web page or support only a single browser.

The W3C organization followed a different path in its attempt to offer additional design options. Rather than introducing new HTML tags, the W3C decided to separate contents from presentation. It developed an additional language that set the graphic representation of standard HTML tags with style sheets. These style sheets offer a significant advantage. Both Microsoft and Netscape support style sheets that provide a common denominator for supplemental Web design. Although the two browsers do not produce identical results, they can both interpret and display all the commands.

Syntax for assigning style sheets

Up to now, the layout of headers, <H1>, depended on the browser. You can now use style sheets to ch ange the display of headers. For example, style sheets can define the size, weight and family of font. Permissable characteristics broadly cover the categories font, text color and background, box and classification. The number of attributes for each characteristic differs. The syntax is quite simple:

The style sheet begins with the name of the HTML element type. Curly brackets enclose all the characteristics being set. A semicolon (;) separates the characteristics. A colon (:) introduces assignments


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


RELATED CONTENT
Web enablement
Changing reserved status of a workflow item
Why you shouldn't change SAP-related workflows in an SWUI
Top 10 SAP tips of 2007
How to integrate BW query iViews with a WebDynpro application
Content management solution for NetWeaver 04 Enterprise Portal
BSP vs Java
Web-enabled workitems
Access Tables Via RFC
Function module for Web RFC
Enabling HTTPS in the Web Application Server

SAP best practices
Minimizing business disruptions during an SAP upgrade or implementation
Retrieving content from an SAP workflow attachment
Updating URLs in SAP SRM
How to change default settings in SAP SRM
What are the benefits of implementing SAP SRM?
Increase column width in a transaction screen
Updating an RT table entry in SAP HR Payroll -- without the ADDWTE option
Is this the quickest way to find a BADI?
Adding custom fields for retail product comparisons in SAP BW
Improving performance with ABAP Objects in SAP Workflow

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary


. The assignments overwrite the default values that the browser already has for these tags. Each <H1> header on the HTML page will now display the new value.

Note: Style sheets interpret an HTML text block (for example with the <DIV> or <SPAN> tags) as a box. The box is later called a layer, but do not confuse this layer with the <Layer> tag of the Netscape browser.

Assignments with classes and identifiers

The last example assigns all the <H1> headers ona Web page the the same style sheet. However, should you wish to change only selected headers, you can explicitly assign a style sheet to a class. You reference the style sheet in the HTML tag with an identifier of your choice by using the class attribute. Nothing in the definition of the style sheet changes except the point before the identifier:

Referencing the style sheet of a class in an HTML tag:

You can also assign style sheets with IDs. If, for example, you wish to specify the point size in a specific text block, you would:

You can define IDs for style sheets with whatever names you desire, as long as the name is preceded by a hash sign (#).

Placing style sheets

As in the case of JavaScript, no predefined rules determine where to place style sheets in HTML pages. However, we recommend placing them in the header. Because the definitions of style sheets do no display any HTML tags, you must frame them with a specific tag: <STYLE>. The following gives text/css as the type:

If you wish to make defined style sheets availabe to several Web pages at once, you should store the definition in an external file. You can then link the file to the header of the Web page with the <LINK> tag.

In addition to placing the definition of a style sheet within a <STYLE> tag, you can also specify them directly in the HTML tag:

We recommend against this form, however, since it violates the principle of separating contents from design.

Note: Although the W3C has standardized the specification of style sheets, the Microsoft and Netscape browsers do not implement it completely. Accordingly, the following comments present only style sheets available equally to both browsers.


To read more about this and other SAP R/3 Internet issues, click to find out about SAP R/3 on the Internet.


Rate this Tip
To rate tips, you must be a member of SearchSAP.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



NetWeaver SAP White Papers
HomeNewsTopicsBlogsTipsAsk the ExpertsMultimediaWhite PapersProducts
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2000 - 2009, TechTarget | Read our Privacy Policy
SearchSAP.com is a search service provided by TechTarget and is completely
independent of and not affiliated with SAP AG.
  TechTarget - The IT Media ROI Experts