css

Centering all HTML form elements using CSS

How do you center all form label and input fields using CSS? How would you do this for a form with label text (block) on top of the input field? #fieldset label { display: block; } #fieldset input { font-size: 0.8em; height: 1.2em; width: 15em; } ...

IE 8 bug regarding overflow hidden in the iframe

Hi, I'm trying to make a rich text editor with the background set on iframes body. The background is repeated in y axis and when the user types in the string without any spaces the horizontal scroll appears and the background is moved to the left. I fixed it with overflow-x:hidden in all browsers except IE 8 where the behaviour is the s...

Problem with line-height and align

I have a element and it is possible that it is longer than one line, so i have to set a line-height>1 otherwise it looks crappy. But if i do that, the lines are higher than the text, and the text is centered. So it does not match the top. How can i change the position of the text to the top of the line, or is there another way to get so...

Is there an elegant way to make/generate spaces instead of &nbsp?

I need to generate spaces in a HTML file. ...

remove specific rules out of inline CSS

hi guys, i'd like to remove some specific css rules (i.e. width and height) out of inline style attributes. so i want to transform the following: <table id="foo" style="border:1px #000 solid; width: 100px; height: 100px;"> into <table id="foo" style="border:1px #000 solid"> is there a handy regex that solves my problem? thank yo...

Why does the :link pseudo selector break expected CSS specificity rules?

To my understanding, the CSS specificity rules indicate that a pseudo selector has the same weight as a tag selector. So a selector like "div p a" would be more specific than "a:link". But as the following test case demonstrates, that does not seem to be the case. Why is the link red? <!DOCTYPE HTML> <html> <head> <title></title> ...

list doesnt display inline IE?

The code below works fine in firefox, but the list doesnt display in-line with IE. <div id="nav"> <ul> <li><a href="#">1</a></li> <li><a href="#">2</a></li> <li><a href="#">3</a></li> <li><a href="#">4</a></li> <li><a href="#">5</a></li> </ul> </div> CSS: #nav { width: 800px; padding: 0px; ma...

Pagination - Removing a large space between bottom of rows and pagination links

Hello, The pagination below works well. It splits a table into 25 rows per page. However, when I click on a page besides page one, there is a large space between the bottom of the 25 rows and the pagination links. I think the problem is related to the CSS. How can I get rid of this large space? Thanks in advance, John /****** bu...

CSS HTML Margin and Padding property

I am using CSS to create a 3-column page layout with header and footer. Take the Left_Col div, for example, which has a width of 200px. I would like to have a left and right padding of 10px for this div such that the text within the Left_Col essentially starts at pixel 10 and wraps at pixel 190. In the below example, to acheive this, I ...

this.call is not a function

For the life of me, I can't see what I'm missing. I had hard-coded the value for selectedIcon in the drawmenu function. It was working perfectly until I changed it to a parameter. I'm getting the following error: Error: this.call is not a function Source File: http://localhost:9090/tests/jquery-1.3.2.min.js Line: 19 ...

how to make this "div" always visible to users

On my site, I have an ajax call to my server that checks if a certain logged in user has a new message from the database.This ajax script checks the database every certain seconds.And if he/she has a new message, I execute this javascript to create a "div" to display to the user.Here is the javascript: function shownotice(b) { divnoti...

How might I get an element's border color value using jQuery?

Using $("#id").css("background-color") to retrieve an element's background color (or most other CSS attributes) works just fine, but $("#id").css("border-color") returns an empty string. How can I get the border color value used on the element? ...

CSS Positioning Puzzle

The image below represents a website layout I am trying to create. The blue section (bottom right) represents an image should be behind the three neighboring elements and overflow them slightly. I do not know the best way to do this, at the minute I have a wrapper div round the colored sections and put a background image in there but I...

Flash video still playing on DIV that is removed using jQuery (IE bug)

I have some jQuery tabs one of which holds a flash video. When I play the video in one tab and click to another in FF or Safari the video stops along with the sound, clicking back to the video tab reloads the content - as expected. In Internet Explorer this is not the case, the video continues to play even when the tab is not selected....

How to truncate text until "more" link is clicked?

I have a long series of paragraphs and I'd like to trim each down to 2 lines (50 characters) and when you click a link "more" it will show the full paragraph. I am using the prototype library and rails. I'd ideally like to do this with out breaking the paragraph into 2 divs and showing the other when you click on more. Or is that the o...

css: fix row height

hi all, i'm having this markup: <style> table { border:1px solid black; width:400px; height:300px; border-collapse:collapse; } table tbody { border:1px solid red; } table td { background:yellow; padding:10px; border-bottom:1px solid green; height:20px; } <...

css parent element to appear above child

I have 2 nested css elements. I need to get the parent to be on top, that is, above in z-axis, of the child element. Just setting z-index is not sufficient. How do I do this? Thanks. http://jsbin.com/ovafo/edit Edit: I can't set a negative z-index on the child, that'll set it to below the page container on my actual page. Is this the o...

CSS and Fonts advice

I am designing an article website and want some samples to look at to choose nice Fonts and CSS. Can you suggest some. Here are some example of what I am seeking: Article Heading Font/Color Article Body Font/ Color Background Color ideas Text Color Layout It will be a two column layout I thought since most of you are professionals,...

How to make the first column of a table invisible?

Below is the CSS code of my table display. How can I modify this code to make the first column invisible? table.tbl { width:100%; border: 2px solid #c3daf9; font-size: 0.9em; clear: both; } td.tbl-header { background: url(/images/head_bg.gif); text-align: center; padding: 3px; font-weight: bold; border-bottom: 2px solid #c3daf9; } tr.tb...

IE prompt about unsaved form data

I'm having an unexpected "annoying" popup in IE7 (and possibly other versions). As expected IE prompts you about unsaved form data when closing the window which is fine. But I have a form inside a div and now when I toggle the display CSS style between none and block, IE thinks I'm closing the form with unsaved data and shows the warning...