css: how to center box div element directly in center?

top and left correspond to the top-left corner of your box. What you’re trying to do is have them correspond to the center. So if you set margin-top and margin-left to negative of one-half the height and width respectively, you’ll get a centered box. Example for a 300×200 box:

CSS display: inline vs inline-block

Inline elements: respect left & right margins and padding, but not top & bottom cannot have a width and height set allow other elements to sit to their left and right. see very important side notes on this here. Block elements: respect all of those force a line break after the block element acquires full-width if width not defined … Read more

@Media min-width & max-width

I’ve found the best method is to write your default CSS for the older browsers, as older browsers (including IE 5.5, 6, 7 and 8) can’t read @media. When I use @media, I use it like this: But you can do whatever you like with your @media. This is just an example of what I’ve found best for … Read more

how to offset a CSS border up and left

We have a WordPress sidebar designed like this: Note the grey border of the large white div is offset up and left (ignore the same effect on the image inside the white div please) – we want the border offset in our final design. I’ve tried building this with HTML: and CSS: However, on the live page the … Read more

CSS Invalid Property Value?

change to Because background is a shorthand property for background-color background-image background-position background-repeat background-attachment

How do I rotate text in css?

You need to use the CSS3 transform property rotate – see here for which browsers support it and the prefix you need to use. One example for webkit browsers is -webkit-transform: rotate(-90deg); Edit: The question was changed substantially so I have added a demo that works in Chrome/Safari (as I only included the -webkit- CSS prefixed rules). The problem you have is that you do not … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)