منتدى برنامج حياه على النت باذاعة صوت العرب
عزيزى الزائر مرحبا بك

انضم إلى المنتدى ، فالأمر سريع وسهل

منتدى برنامج حياه على النت باذاعة صوت العرب
عزيزى الزائر مرحبا بك
منتدى برنامج حياه على النت باذاعة صوت العرب
هل تريد التفاعل مع هذه المساهمة؟ كل ما عليك هو إنشاء حساب جديد ببضع خطوات أو تسجيل الدخول للمتابعة.

A brief CSS2 tutorial for XML

اذهب الى الأسفل

A brief CSS2 tutorial for XML Empty A brief CSS2 tutorial for XML

مُساهمة من طرف manal kamal الأحد فبراير 28, 2010 11:48 am

CSS can be used with any structured document format, for example with applications of the eXtensible Markup Language [XML10]. In fact, XML depends more on style sheets than HTML, since authors can make up their own elements that user agents don't know how to display.

Here is a simple XML fragment:


Fredrick the Great meets Bach

Johann Nikolaus Forkel


One evening, just as he was getting his

flute ready and his

musicians were assembled, an officer brought him a list of

the strangers who had arrived.



To display this fragment in a document-like fashion, we must first declare which elements are inline-level (i.e., do not cause line breaks) and which are block-level (i.e., cause line breaks).

INSTRUMENT { display: inline }

ARTICLE, HEADLINE, AUTHOR, PARA { display: block }

The first rule declares INSTRUMENT to be inline and the second rule, with its comma-separated list of selectors, declares all the other elements to be block-level.

One proposal for linking a style sheet to an XML document is to use a processing instruction:





Fredrick the Great meets Bach

Johann Nikolaus Forkel


One evening, just as he was getting his

flute ready and his

musicians were assembled, an officer brought him a list of

the strangers who had arrived.



Notice that the word "flute" remains within the paragraph since it is the content of the inline element INSTRUMENT.

Still, the text isn't formatted the way you would expect. For example, the headline font size should be larger than then rest of the text, and you may want to display the author's name in italic:

INSTRUMENT { display: inline }

ARTICLE, HEADLINE, AUTHOR, PARA { display: block }

HEADLINE { font-size: 1.3em }

AUTHOR { font-style: italic }

ARTICLE, HEADLINE, AUTHOR, PARA { margin: 0.5em }

Adding more rules to the style sheet will allow you to further improve the presentation of the document.
manal kamal
manal kamal
مدير المنتدى
مدير المنتدى

كيف تعرفت على المنتدى ؟ : غير ذلك
تاريخ التسجيل : 19/01/2010

http://wwwalmarefa.blogspot.com

الرجوع الى أعلى الصفحة اذهب الى الأسفل

الرجوع الى أعلى الصفحة

- مواضيع مماثلة

 
صلاحيات هذا المنتدى:
لاتستطيع الرد على المواضيع في هذا المنتدى