character, followed by the name of the class. google_ad_client = "pub-7891292310029227"; Removed these and it’s all sorted. google_ad_width = 728; Each section can then have its own formatting, as specified by the CSS. google_ad_type = "text"; CSS Tutorial > CSS Div and CSS Span Div. Definition and Usage. HTML elements Chapter 6: CSS Spans. can also refer to more than one class (look at Example 2 below). .separator span{}, If you anted to target ONLY DIRECT CHILDREN of .separator that are span ( and dont mind not supporting IE6) I would suggest you use: With the way the menu works I cannot give the inner span a class as far as I know. Div (short for division) divides the content into individual sections. .separator span:first-child {} will only target spans in .separators that are the FIRST ELEMENT (not the first of type, as that a different pseudo class ) within their respective container. The .class selector selects elements with a specific class attribute.. To select elements with a specific class, write a period (.) No linebreak is created when a span is declared. Which works great on the first menu item, but then the rest down further still get styled incorrectly. character, followed by the name of the class While using W3Schools, you agree to have read and accepted our. No linebreak is created when a span is declared. There may be something else going on here. Spans are very similar to divisions except they are an inline element versus a block level element. You can also specify that only specific HTML elements should be affected by a class. google_color_link = "ff6600"; How to select a span inside a span with CSS. google_ad_channel = ""; AND to class="large": If you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail:

This paragraph refers to two classes.

, W3Schools is optimized for learning and training. Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, PHP, Python, Bootstrap, Java and XML. BTW The purpose of the last 2 chapters was to provide you with a basis for using CSS in an (X)HTML file. google_color_url = "ff6600"; The final result is: This text is italic. Top Of Page, CONTENT © 2004-2008 CSS BASICS, a site by. google_ad_format = "728x90_as"; .separator>span {}. To do this, start with the element name, then write the period (.) I’ve tried the following code: Which in turn, styles both span elements and breaks the look in IE8/9. //--> Spans are very similar to divisions except they are an inline element versus a block level element. google_ad_height = 90; I need to know how to style just the inside span, which I assume requires a different selection with CSS. Select and style all elements with class="intro": The .class selector selects elements with a specific class attribute. For a more detailed explaination of XHTML please visit W3Schools,