css

floating stuff within a div, floats outside of div. Why?

This is just a basic question, but I've had this happen to me a couple times and would like to know why. Say you have a div, say you color it green and give it a definite width, when I put stuff within it, in my case an img and another div. The idea is that the content of the container div will cause the container div to stretch out, an...

Dual Column Layout in CSS with dynamic height in IE

I have a dual column layout using CSS: <div id="nav"></div> <div id="left_column"></div> <div id="right_column"></div> <div id="footer"></div> #left_column{ float: left; width: 463px; display: inline-block; margin-left: 12px; } #right_column{ float: right; width: 463px; display: inline-block; marg...

Alert the count of <li>s in an adjacent <div> to a button being clicked.

Hey, This is my first post but this website has been very useful so here goes... Oh and im just a beginner ;-) I have a button (a div with a class) and another div inside an element side by side. Inside the second div I have a ul and a number of li's that will dynamically change. when the button is clicked, I need the count of li's in...

Is there any online text editor for HTML, CSS with saving and syntax highlighting facility?

I want to make css file from accessible from everywhere (home, office etc) and ready to edit. and save. I will do hand coding ,just want syntax highlighting and saving on net facility. I tried google docs (it's good because i can save online and it has revision history feature too which is useful) but it doesn't have syntax highlighti...

CSS floating issue

I know this is a srs beginner question, but here goes: I am trying to get a box, with an icon in the top left corner, and all the content of that box will be to the right of the icon. This is the code I am using: <div class="statsbox float_left"> <img src="images/chart_bar.png" class="float_left"> <div class="float_left"> ...

Modal centering problem in IE6

Hi, I'm using a popup modal on my site but have an issue with the dreaded IE6. The modal pops up smack bang in the middle of the page until the page is a long scroll, then IE6 opens the modal but you need to scroll up to find it. The code I'm using is as follows. $(id).css('top', winH/2-$(id).height()/2); $(id).css('left', winW/...

Change select's class based on selected option's class

I have a page that contains numerous <select> elements. What I'm trying to achieve is to ensure that if a <select>'s selected <option> has a class called italic, then the <select> then has the italic class added (i.e. jQuery.addClass('italic')). If it doesn't, then the italic class is removed from the <select> to ensure other <option> e...

How to add a class to a table cell (td) in reStructuredText

I am trying to figure out if there any syntax where a class can be applied to a td in reStructuredText (RST), rather than a span around the table cell contents. The closest I came was this: .. role:: custom .. csv-table:: Frozen Delights! :header: "Treat", "Quantity", "Description" :widths: 15, 10, 30 "Albatross", 2.99, "On ...

How to find an element using CSS2 Selector in Motoools and hide it?

Hello! How can i find this span element with class="rocon.rocon-br" in #conttile2 by Mootools' Css Selector? This element is created dynamically by Javascript (rounded corner), so this is what i see in Dragonfly Dom tree for it: html > body > div#wrapper.wrapper > div#penalties.container > h2#conttitle2.rc10.rocon__8.rocon-init > span....

How to order properties in a declaration block?

I know there's no real right or wrong answer. I'd just like to hear from CSS developers how you like to order your properties and what is your reasoning behind your preference. Thank you very much. ...

overriding border of parent div with border of child span

I have a div that has a row of tabs nested within it as follows: <div class="container"> <div class="menu"> <span class="tab" /> <span class="activetab" /> <span class="tab" /> </div> </div> When a tab is active, we need to display a border around it. The container div also has a border; however, it nee...

Replacing CSS with JavaScript

I'm relatively new to client-side programming coming from the PHP/MySQL environment. I understand the roles both CSS and JavaScript can play in the browser environment, however, it appears CSS is irreversibly stagnant without JavaScript. I by no means want to create a debate but this is what the situation looks like to me, the "novice." ...

iphone support Screen media type then how to make PC website compatible with iphone screen?

iphone support "Screen" media type then how to make PC website compatible with iphone screen? While both uses same media type? I know iphone do not support FLASH but if website has fixed width images, uses of jquery and 960 px fixed width. then how to make compatible with small screen iphone. ...

inline elements, and markup white space rendering issues

Way back in the day, we had to deal with browsers adding white space between elements if in the source markup we also had white space. I thought that issue had all but disappeared but I rant into a situation today where the problem still exists. What's odd is that the problem isn't confined to a particular browser. It shows up the same...

Use CSS (and maybe JavaScript) to make an element be square (or maintain a specific aspect ratio)

I have a div that I want to have the following characteristics: Width = 50% of its parent element Height equal to whatever it needs to be in order to maintain a certain aspect ratio. I need to use percentages because the object will resize left-right when the browser is resized. I want the object to be resized top-bottom to ensure th...

CSS: Unable to set tbody height in % for scroll.

Hi, I'm trying the CSS solution to scrolling table contents while keeping the header fixed. CSS Code 1: <style type='text/css'> * { padding:0; margin:0; border:0; } #ListData { display:block; width:100%; height:100%; float:left; background:#ffffff; } #ListData...

Center a div inside another div

Hello! I'm trying to set a div centered inside another div. This is the html page: <body> <div id="divParent"> <div id="divHeader" > <div id="divHeaderText"> </div> </div> <div id="divBody"> </div> </div> </body> And this the style: #divHeader { background-color: #C7C7C7; font-family: Verdana...

How to remove drop down menu indicator on a button in a XUL Firefox extension?

I'm working on a Firefox extension that creates a toolbar in the browser. I'm using a with type="menu" to create a menu that pops up when the button is clicked. By default, setting type="menu" creates a little menu indicator triangle, like in this image: Is there any way, either in XUL or in the CSS, to get rid of this indicator tr...

CSS positions image in centre of screen in all browsers but IE

Hello all: I couldn't find a similiar question in the related questions section, so figured I'd try my luck. I'm designing a page where the load time will noticeably long enough to where a loading icon could appear. Currently I have it set so that the icon displays in the center of the screen, with a translucent overlay over the page u...

add header when page breaks when using page-break-inside: avoid wth css or javascript or from browser??

hi all i have a page that has sections as divs with inner divs and content. The numberof divs varies alot from less than a page to many pages when printing. I am using page-break-inside: avoid on every section div so that all sections are never printed / split accross 2 pages. (This i only get to work in firefox but that whole other...