Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS for top right corner of the page

Tags:

html

css

How would I have a top right corner div as shown in the image. I want to do something similar though not exactly the same. I think the text is not an image.

alt text

Also, I have seen some websites that has a page hover effect when a mouse is over the top right section. Any idea how to do that?

like image 345
Nick Avatar asked Mar 26 '10 21:03

Nick


People also ask

How do you align top right corner in CSS?

Try using float: right; and a new div for the top so that the image will stay on top.

How do you put a div in the top right corner?

you can play with the top and right properties. If you want to float the div even when you scroll down, just change position:absolute; to position:fixed; . Hope it helps. Save this answer.

How do you put a button in the top right corner in CSS?

How do you put a button in the top right corner in CSS? If you want to move the button to the right, you can also place the button within a <div> element and add the text-align property with its "right" value to the "align-right" class of the <div>.

How do I move to the right side of the page in CSS?

The easiest way to move content is the float property. It will take content and move it to the left or right sides of the page.


3 Answers

If the text isn't an image, none of the other answers will work. Here is some css that rotates a div 45 degrees and works in IE + FF + Webkit.

#yourdiv
{
    top: 0px;
    right: 0px;
    -webkit-transform: rotate(45deg);
    -moz-transform: rotate(45deg);
     transform: rotate(45deg);
     filter: progid:DXImageTransform.Microsoft.Matrix(M11='0.7071067811865476', M12='-0.7071067811865475', M21='0.7071067811865475', M22='0.7071067811865476', sizingMethod='auto expand');
}
like image 122
jps Avatar answered Sep 21 '22 03:09

jps


Make sure it's a transparent PNG

#Element {
   position: fixed;
   top:0;
   right:0;
z-index:10;
}

(An element with greater stack order is always in front of an element with a lower stack order.)

like image 38
Ahoodie Avatar answered Sep 23 '22 03:09

Ahoodie


div.topRight {
    position: absolute;
    top: 0%;
    right: 0%;
}

This will assign a division with class set as 'topRight' to the top right corner. I'm sure you can figure out how to get the image to show up properly from that. Make sure you set the proper width and height on it. As for hovering, what exact effects do you want? You can modify the CSS on hover easily, if that's all you want to do.

div.topRight:hover {
    // new css rules
}
like image 30
animuson Avatar answered Sep 22 '22 03:09

animuson