css

How can I remove unused CSS classes from my website project?

My project has collected CSS entropy (unused classes) during its course of development. Now in order to keep the CSS file small, I want to remove all unused CSS references. But doing that manually involves searching for each class in the entire project. That takes time. Do you know of any way/tool which I can adopt to find out which CS...

Firefox CSS: Given 2 divs, how can I float the *second* one to the right using static positioning?

I'm working on a Youtube userstyle script that displays comments side by side with the video so you can watch the video and read the comments at the same time (what a marvelous idea - duh). You can see in the screenshots how far I've got. That means I only care about Firefox, and that CSS3 goes. The problem I have is that I want to make...

CSS2 Selectors and Style override

This is the HTML: <div id="testBlue"> <span>hello</span> <span id="testGreen" class="testGreen">hello2</span> </div> If I have set in CSS: #testBlue span { color:Blue; } .testGreen, #testGreen { color:Green; } How can I override the general style in the second SPAN? I have tried both id and class selectors but it doesn...

CSS Best Practice about ID and Class?

I've been dipping into SitePoint book concerning CSS. The thing that struck me about the examples was the use of ID as a CSS selector. Some bits of CSS design I've done, I've always found it easier and more versatile to use Class as the selector. Maybe its a .Net thing as we don't always have control of the ID of an element... Is the...

Vertically center a title with fixed height in css

I have a header <h1>My Header</h1> It has a height of 150px and a font-size of say 1.3em; How can I make the header text vertically centered with CSS. I would rather not wrap it in a container DIV (wrapping divs really defeat the whole CSS idea). ...

html: text decoration of a link without css

i need to to some (technically awful but still good looking) table designs for blackberries that have all css support disabled. i don't seem to find out how to get my links to display as follows without css: <style type="text/css"> a.hover { border:0; } a { text-decoration: none; } </style> is it even possible, just using html?...

Screen scraping pages that use CSS for layout and formatting...how to scrape the CSS applicable to the html?

I am working on an app for doing screen scraping of small portions of external web pages (not an entire page, just a small subset of it). So I have the code working perfectly for scraping the html, but my problem is that I want to scrape not just the raw html, but also the CSS styles used to format the section of the page I am extractin...

Is there an html css normalizer that works?

Long ago, I wrote a style 'normalizer' program to scan the ASP/HTML code of a big pile of classic ASP pages (most of which were originally generated from MS-Word documents, so naturally they were littered with superflous stylesheets and massive one-off styles). The style normalizer generated a minimal set of stylesheets and styles and a ...

How to center an image horizontally and align it to the bottom of the container?

How can I center an image horizontally and aligned to the bottom of the container at the same time? I have been able to center the image horizontally by its self. I have also been able to align the bottom of the container by its self. But I have not been able to do both at the same time. Here is what I have: .image_block { width...

css li menu dynamic line widths in IE6

I've got a css menu like this: <ul> <li><a>Item1</a></li> <li><a>Item Two</a></li> <li><a>Item C</a></li> <li><a>A Rather Long Menu Item Down Here</a></li> </ul> I want to create this: |-----------------------------------| | Item1 | |-----------------------------------| | Item Two ...

How to prevent text in a table cell from wrapping

Does anyone know how I can prevent the text in a table cell from wrapping? This is for the header of a table, and the heading is a lot longer than the data under it, but I need it to display on only one line. It is okay if the column is very wide. My (simplified) table is structured line this: <table> <thead> <tr> <th> ...

Is there a way to force IE or FF into a handheld mode for testing "@media handheld" stylesheets?

Is there a way to force IE or FF into a handheld mode for testing "@media handheld" stylesheets? Or, do I have to publish the pages and test with my Blackberry? I'd prefer to test this without pushing the application to the live server as the application is already in use. Any ideas for me? ...

How to Include Multiple Javascript Files in .NET (Like they do in rails)

I'm jealous of the rails guys. They can do this: <%= javascript_include_tag "all_min" %> ... and I'm stuck doing this: <script src="/public/javascript/jquery/jquery.js" type="text/javascript"></script> <script src="/public/javascript/jquery/jquery.tablesorter.js" type="text/javascript"></script> <script src="/public/javascript/jquery...

CSS Borderless tabs using images

On the user pages of Stack Overflow where the tabs are (Stats, Recent, Responses, etc.) you get the illusion that the tabs are extensions of the line they're sitting on. Stack Overflow creates this effect by defining pure CSS borders. I want to achieve the same effect but I have images both for the tabs and for the line they're sitting o...

CSS way to horizontally align table

I want to show a table of fixed width at the center of browser window. Now I use <table width="200" align="center"> But Visual Studio 2008 gives warning on this line: Attribute 'align' is considered outdated. A newer construct is recommended. What CSS style should I apply to the table to obtain the same layout? ...

Find <a class="button"> elements that do not contain <img>

I have the following markup for buttons (can be changed, but I really don't want to): <a href="#" class="button"> Button text <img src="someimage.png" /> </a> This is styled using CSS to become a rather neat button with an icon on it. I am using jQuery to round the leftmost side of the buttons: $('a.button').corner('tl bl 10px');...

Style ancestor element of form input:focus (jQuery)

I have a form with a DIV, 3 INPUTS, each INPUT sits within a LABEL element. I would like to change the background image of the DIV element when focusing on each INPUT. I can't move back up the DOM to fix this with CSS, so could someone suggest a few lines of jQuery please? Thanks ...

ASP.Net LinkButton CSS Adapter

Does anyone know of a CSS Adapter for the LinkButton control for ASP.Net 2? Update: We are trying to use CSS Buttons. We are using this approach: http://www.oscaralexander.com/tutorials/how-to-make-sexy-buttons-with-css.html For that we need to render the tags which the link button doesn't do. Possible Solution using Adapter We crea...

setting a:visited link to same state as a:link and a:hover

Hi, I'm working on a idea where my a:link have one state (blue, no underline etc) with a a:hover being white. I want my visited links to have the same state as a:link and a:hover. Is this possible? supported in most common browsers? thanks giles ...

Contextual Selectors in CSS2

I'm wondering why styling an element within a specific class, like this: .reddish H1 { color: red } is shown as an example of correct syntax in the CSS1 specification under Contextual selectors: Cascading Style Sheets, level 1 but it's not shown as an example in the CSS2 spec: Cascading Style Sheets, Level 2 At least I can't find ...