Cascading Style Sheets FAQAnswers to frequently asked questions about Cascading Style Sheets.How do I make the text fit alongside an image bar- (Found July 8, 2008 ) A: It would preferable to control your image placement than try to restrict the size of the fonts, which can be very harmful to the legibility of your documents. One suggestion is to put the text in a div element with a specific class, and set the bar as a background image.http://www.codestyle.org/css/FAQ.shtml#imagebar How do I style list elements- (Found July 8, 2008 ) A: List items can be selected in CSS using the li element selector. It is also possible to select and style items in un-ordered lists independently from those in ordered lists, and style specific items, as below.http://www.codestyle.org/css/FAQ.shtml#stylelistelements What is "presentational markup"- (Found July 8, 2008 ) A: The most common example of HTML used primarily for presentational effect is the font element, which may specify the font family, size and colour of text on screen. Other textual examples include big, small, b and i elements, or the link, background, vlink and alink attributes of the body element.http://www.codestyle.org/css/FAQ.shtml#presentationalmarkup Where can I find out more about CSS- (Found July 8, 2008 ) A: The primary source of answers to frequently asked questions about CSS is the comp.infosystems.www.authoring.stylesheets (C.I.W.A.S) newsgroup FAQ.http://www.codestyle.org/css/FAQ.shtml#ciwas Has the stylesheet loaded- (Found July 8, 2008 ) To check if an external stylesheet file has loaded, add an extreme style rule to make it obvious and reload the HTML:http://www.codestyle.org/css/FAQ.shtml#styleload How can I hide my CSS- (Found July 8, 2008 ) A: It is not possible for you to prevent read access to CSS files on the server side and have client browsers render the stylesheet. The browser must be able to download a CSS file to render the styles it contains, this is the nature of the Web. The only way to prevent others viewing your CSS is not to publish it at all.http://www.codestyle.org/css/FAQ.shtml#hidecss Can I resize a whole site with CSS- (Found July 8, 2008 ) A: If the site was designed for a fixed size then it may be quite difficult to adjust. If the widths of the page elements are set exclusively in the CSS, not in HTML tables, you may be in with a chance; it would make the job easier. But the standard markup of the page may be the limiting factor. If the document markup is too rigid, you may need to go back to the drawing board.http://www.codestyle.org/css/FAQ.shtml#resizesite Can I use script variables in my CSS- (Found July 8, 2008 ) A: Yes, you can use an ASP, JSP or other scripting mechanisms to customise a style sheet, but you must serve it with the right HTTP Content-Type header: textcss. Also, bear in mind that what you serve one person, may be held in shared caches and viewed by other people too. So, to ensure that everybody else gets the default style sheet settings, you should also set no-cache headers.http://www.codestyle.org/css/FAQ.shtml#scriptvars How can I block overrides from another stylesheet- (Found July 8, 2008 ) A: CSS is implemented in a way that applies a style sheet to the whole of a Web document; specific style rules are attached to page elements based on selectors. One style sheet cannot "block" part of another, but you can override a style rule with a more specific selector.http://www.codestyle.org/css/FAQ.shtml#blockstylesheet How can I set the width of a div for any monitor- (Found July 8, 2008 ) A: The most reliable way to ensure that HTML elements are sized according to the canvas area of users' Web browser, whatever their monitor resolution, is to use percentage length units. The overall width of an HTML element is also affected by any margin, border and padding that is set. If you choose to use 100% width for an element, you should ensure that the margin, border and padding properties are set to zero or you will get horizontal scrolling.http://www.codestyle.org/css/FAQ.shtml#percentwidth |