css

How to get height of <div> in px dimension

Hi, I have used jquery library to find out height of div. Below is my div element with attributes : <DIV id="myDiv" style="height:auto; width:78;overflow:hidden"> Simple Test</DIV> Below is my jquery code to get height of <div> var result = $("#myDiv").css('height'); alert(result); After executing above statement I am getting res...

JS: querySelectorAll with respect to z-index

I would like to select all "div" elements that are children of the "body" and have z-index: 2 property set. document.querySelectorAll('body > div'); How do I involve the z-index check on this querySelector? ...

Why would you use a HTML/CSS width of 99.9% instead of 100%?

I have seen many developers writing HTML or CSS inline style widths of 99.9% in places where I would use 100%. Is there any valid reason for using 99.9%? Does it have any effective difference from 100%? EDIT to retweet MSalters' very good question: Considering that 99.9% is one pixel off above 500 pixels, why not 99.99%? I'd guess he...

Detect iPhone/iPad purely by css

Hello, I've been trying to detect an iPhone or iPad purely by stylesheet. I tried the solution provided here by using @media handheld, only screen and (max-device-width: 480px) {. However, this doesnt seem to work. Any ideas? ...

jQuery hide/show

Hey guys, I have created a slide-show using jquery cycle, this contains play and pause controls, tabbed navigation and fade transition between slides, now I've been asked to hide the play and pause controls once the slide-show hits slide number 6 but to have this controls back on when the slide-show starts all over again, I need help cre...

Change Font Size to automatically fit Div's height/width

Hello Stack! I'm trying to make text automatically resize to fully fit inside a static 200 width 100 height div. Basically I want the maximum font-size available depending on the lenght of the content fed in the div. I'd like to use the least amount of Javascript/Jquery possible. Thanks in advance! ...

CSS on anchor tags

If i have the following: <div class="linkSet"><a href="#" class="main_link">link one a</a><a href="#" class="sub_link">link one b</a></div> How do I set the CSS so if I hover over the first one, it changes the background colour for both anchor tags? ...

HTML+CSS Table, trouble setting borders

Hi all, I'm trying to make a Sudoku board online using an HTML Table and formatting it with CSS. Ideally the output would look like this image: http://www.examiner.com/images/blog/wysiwyg/image/sudoku.png The problem is I'm having trouble setting the borders properly. Below is the code for a single 3 by 3 box, it unfortunately isn't ou...

Background images not showing in Firefox

Hi all, I have a firefox-specific issue with this page : http://www.buzzarab.com/feedback.php It renders fine in IE, Safari, Chrome and every other browser invented by man, but in Firefox the background images do not show (The 'Feedback' link on the left and a white box around the content). Any help appreciated, I'm completely stumped...

Apply styles with jQuery

Given this CSS: #gbox_MyGrid .s-ico span { display:none; } How would one apply this and unapply it programatically using jQuery? That is we'd dynamically set this style to none (hide) and "" (show) using jQuery. Not sure how you create a jQuery id representing #gbox_MyGrid .s-ico span For background on why you'd want to do this...

How can I load the attributes of a CSS class in a stylesheet directly into a hash using JavaScript or jQuery?

I want to load the key value pairs from a class, or id, in a CSS stylesheet into a JavaScript object in order to access the data. Note that I do NOT want to add that class to a DOM element (at least not directly) The only way I can see in JQuery is to create a dummy hidden element, add my class to it using $(“#dummy").addClass(“myclas...

Weird Border-Left:none on one element of menu?

On this site I am doing the template for: http://questionlounge.com/ The "Latest Questions" menu tab has a strange element style added to it that is border-left:none; I can't see how it gets there as the CSS and markup is fine. Any ideas on this one? Thanks ...

Why are the images not showing in IE7?

I am trying to help out a client. The site is almost ready to go, but there are a series of images that simply disappear in IE7. The site click on the Leadership tab and the whole block of content vanishes. Here is the html for that section: <div id="leadership-content" class="content"> <p class="intro">Leadership for every compan...

iPhone CSS - Viewport width not working for me

Anyone know why I still have some extra white space to the right of my web site when using an iPhone?: (please check on an iPhone - this will not show with Firefox/UA Switcher) I've adjusted viewport meta to "device-width" and my body's width is 100%. I've Firebugged everywhere and just can't figure this one out. ...

How to add left , center and right background in menu item?

I am creating menu using css and have three background stripes ( left, center & right) to display. I can add only one background for 'li'. How can I add others? ...

adding on ?v=1 to urls

As seen in the code from http://html5boilerplate.com/ (ctrl+f "?v=1") What does ?v=1 do exactly? It's tacked on to the external css and js urls. ...

jQuery ui autocomplete - .ui-autocomplete-loading

I'd like to apply this css to the search box while it is fetching the XML file. Currently it takes ~3 seconds to load this file. I see in the autocomplete.js file these two functions: _search: function( value ) { this.term = this.element .addClass( "ui-autocomplete-loading" ) // always save the actual value, not...

How can I convert this table-based layout to use semantic html with css-based layout?

In the image above, most of the html is semantic, using css to manage the look of it all. Despite my best efforts, though, I had to resort to using a table to get the segment on the right to stay where it is and allow its inner elements to wrap fluidly when it gets too big for the screen, like this: I know that it's preferable if tab...

Items unclickable/selectable/focusable in IE after being hidden/shown with jQuery

I have a set of tabbed divs that I am hiding and showing with jQuery hide() and show(), this works great in all browsers except IE where the tabbed elements that have been hidden, when shown, are not clickable as links, or focusable/selectable as form select, text field, etc. Has anybody had experience with this? Is there some sort of r...

How to work around IE6/IE7 margins disappearing when relatively-positioned floated div is moved with jquery .hover()?

Here is my code: http://jsbin.com/uhera3/edit When I use jQuery to .hover(), the relatively positioned floated divs jump to the left (seemingly losing their margins) in IE7. Any ideas how to fix this? ...