css

Why can't I center with margin: 0 auto?

I have a #header div that is 100% width and within that div I have an unordered list. I have applied 'margin: 0 auto' to the unordered list but it won't center it within the header div. Can anybody please tell me why? I thought that if I define the width of the parent div, then the unordered list should be able to center itself with ma...

How can I center something if I don't know ahead of time what the width is?

I am trying to center a paragraph tag with some text in it within a div, but I can't seem to center it using margin: 0 auto without having to specify a fixed width for the paragraph. I don't want to specify a fixed width, because I will have dynamic text coming into the paragraph tag and it will always be a different width based on how m...

Simple way to take css-styled box from another website?

I really like a div box that is styled a particular way on another webpage. I'd like to incorporate the box into my website. Is there a simple way that I could get the div box on my site? (I feel like I'm going to have understand the entire CSS file before I can make something similar, that is why I am asking). ...

Banded grid view in XHTML Strict + CSS

I'm trying to create a simple banded grid view in XHTML Strict with CSS. For an example see this picture of a devExpress GridView. The main issue is how to create a table where each entry consists of multiple rows. Of course, something like <table> <tr><td> <table> <tr> <td width=100>Item 1, cell 1</td> <td width=200>Ite...

Applying square bullets in css affects numbers

When I use this in my css to achieve square bullets: li { list-style-type: square; } it affects all numbered lists as well, as they both use <li> The context is within a sharepoint richhtmlfield control. Is there a way around this or have Microsoft not implemented numbered lists correctly? ...

CSS 2, precedence of stylesheets imported using link element

Given <link rel="STYLESHEET" href="/css/t.cake.css" type="text/css"/> <link rel="STYLESHEET" href="/css/f.css" type="text/css"/> <link rel="STYLESHEET" href="/css/t.generic.css" type="text/css"/> <link rel="STYLESHEET" href="/css/t.head.css" type="text/css"/> which rules have a higher priority in the cascade? Assume all have equal pri...

Seam 2.1 issue: losing theme

I'm developing a web application with Seam but suddenly the theme has stopped working. I've reverted the latest changes and it doesn't solve it. I've even reinstalled the JBoss (5.1) server but it doesn't fix it either. I see no error in the logs, just the css theme is not being shown (although it's there in the server), no css errors i...

Removing <link> element with jQuery?

Hello, I don't want to use styles from style.css, so I decided to remove style.css from DOM. This work just fine in Firefox and IE8, but not in IE6: $("LINK[href='http://www.example.com/style.css']").remove(); Any other solution, with jQuery? Here is example: HTML: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ...

Are general purpose CSS classes wrong?

Let's say I have cleaner like this .cleaner:after { content: '.'; display: block; clear: both; visibility: hidden; height: 0; } so I can add class cleaner to everything I want to clear floats. This is imho much better way than adding <div style="clear:both;"></div> instead, because it doesn't re...

Size block-DIV based on absolutely positioned sub-DIV?

Hi, I have a container DIV which contains several block-DIVS. Every block-DIV contains SPAN items with values. The blocks have the same WIDTH as the container and are floating in the container, so it looks as if they are 'rows'. The SPAN items are floating inside the block-DIV. Every block has a fixed height of 25px. I want to increase...

removing page scrollbars in IE8 (overflow:hidden not working)

Applying this overflow:hidden; to the body of my document has no effect in IE8. Any ideas why? ...

Help needed with DIV-layout for site

Hi I am trying to build a page with the following in it: Already have the following: one div for page to center the whole page with width 809px inside <div class="page"> is the following: <div class="header"> <div class="container"> (container for content stuff) <div class="footer"> What I am struggling with: <div class="contai...

Jquery .Click applies to all sub divs?

HTML: <div id="lowerLayer"> <div id="positionLayer"> <div id="imageLayer"> <div id="imageHolder" style="background-image: url('/Images/Loading/ajax-loader.gif');"> </div> </div> </div> </div> CSS: #lowerLayer { position: fixed; top: 0px; left: 0px; right: 0px; botto...

Using jquery to create overlay but content inherits CSS opacity- can you help?

Hi there, I created a sort of modal overlay and then a content with the overlay.. the modal overlay has opacity set and it works but the content of the overlay also has opacity.. i think its inheriting it... I don't really want to apply a new class to the content, is there a way to say only apply to here is my css .modal-overlay { ...

vertical align div within a div using jquery?

Hi there, Anyone have any experience with jquery vAligh plugins or similar? I tried to align for the following but it fails.. I was using a simple valign plugin (I will put the plugin at the end, its a jquery extension), if anyone can help it would be really helpful... var overlayLayer = $("<div id='office-location'></div>").addClass...

Lock browsers

Hi, I have a pretty simple question, but with an answer that I am unable to find. I was wondering if it is possible to lock a web browser (sticking with IE for now is fine) from being resized under (or past or smaller than) a certain set of dimensions. For example, a new pop up window that starts at 500px by 500px, but can be enlarged ...

Placing an Icon on the edge of a border

Hello, I am new to CSS and trying to achieve the following effect: I have a table with short text lines in each cell, I want to be able to put 1-N small icons on the middle of the cells borders. A small sketch that might help visualise it: http://img200.imageshack.us/img200/6506/sketcha.jpg I would be thankfull for any guidance. Re...

How do I vertical center text next to an image in html/css?

What is the best and easiest way to vertically center text that's next to an image in html? Needs to be browser version/type agnostic. A pure html/CSS solution. ...

IE7 input:focus

I have the following CSS which isn't working in IE7. input:focus{border-width: 2px;border-color: Blue; border-style: solid;} Basically, I just want to set the border attributes when the input is focused. Works in Firefox etc... If anyone could explain why it isn't working in IE 7 and suggest a possible workaround it would be appreci...

br line-height in safari and chrome leaving gap

In my HTML I have a div and inside the div I have different vertical spacing between lines of text. I achieve this by using breaks and defining the height, i.e. <br /><br class="height5" /> or height2 or height10 or whatever. In my stylesheet I define it like: br.height2 {line-height:2px;} br.height5 {line-height:5px;} This is worki...