473,385 Members | 1,531 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

CSS Element over another on right bottom corner

rblaettler
Hey
I need to position an Icon OVER the right bottom corner of an other CSS element, but with variable height and width. So just absolute positioning would not work.

I have something working with tables:

Expand|Select|Wrap|Line Numbers
  1. <table width="100%"><tr>
  2.     <td>
  3.         < HERE IS THE MAIN ELEMENT />
  4.     </td><td></td></tr><tr><td></td>            
  5.     <td style="width:1px;">
  6.         <div style="position:relative;">
  7.             < HERE IS MY ICON style="position:absolute; top:-30px; left: -30px;" >            
  8.         </div>
  9.     </td></tr>
  10. </table>
It should look like something like this:

Expand|Select|Wrap|Line Numbers
  1. *******************
  2. *                 *
  3. *                 *
  4. *                 *
  5. *                 *
  6. *             *** *
  7. *             *   *
  8. *             *   *
  9. *******************
  10.  
This works, but it's ugly...
Any better ideas?
Jul 24 '07 #1
3 5088
drhowarddrfine
7,435 Expert 4TB
Why wouldn't abs pos work?
[HTML]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<meta http-equiv="content-type"
content="text/html;charset=utf-8">

<style type="text/css">
html,body{height:100%;width:100%;
margin:0;padding:0
}
div{
position:relative;
height:200px;
width:200px;
outline:1px solid red;
}
img{
position:absolute;
height:20%;
width:20%;
right:0;
bottom:0;
}
</style>

</head>
<body>
<div>
<img src="1.png">
</div>
</body>
</html>

[/HTML]
Jul 24 '07 #2
tburger
58
As long as the desired element is located inside the div whose corner you want to cover, drhoward's suggestion will work.

Even at a variable heights and widths, if you position the "corner element" absolutely with its bottom and right attributes set to 0, it will stay right where you want it...

Tom
Jul 24 '07 #3
Awesome, that really fixed it. Never even thought of that approach.
Thanks a lot guys.
Jul 25 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Markus Ernst | last post by:
Hello Reading the follwing document: http://www.w3.org/TR/WD-positioning-970131#In-flow it seems very clear that position:relative should be relative to the parent element. So in the following...
4
by: mercurius_1 | last post by:
I want to put text for a copyright notice into the bottom right corner of my page. When I say "bottom right," I mean that it will float there regardless of how the browser window is resized. I...
1
by: Tristan Miller | last post by:
Greetings. Here is the scenario: I have an element div.aside which is absolutely positioned in the bottom right corner of its containing box, div.frame. Said containing box is then resized...
21
by: Michael Bierman | last post by:
Please forgive the simplicy of this question. I have the following code which attempts to determine the color of some text and set other text to match that color. It works fine in Firefox, but does...
4
by: Sheri Orloff | last post by:
After using a 3-column template from Ben Meadowcroft which I like the looks of, I need to add an element but don't know how to do it. On the right side of the page...
4
by: Andre Majorel | last post by:
How do you align an <imgagainst the bottom-right corner of an enclosing block so that the text in the block flows around it ? <!-- Block begins here --> <p> En ce qui concerne la conjoncture...
3
zybernau
by: zybernau | last post by:
Hi everyone, how to find the position of the right bottom corner of the screen i need to design a form and make it display in the right bottom corner , this should work even in various...
2
by: steven acer | last post by:
i'm illiterate when it comes to javascript and browser issues, i'm trying to code a small help module for my java app.i've went far enough coding all the server side but i'm stuck with javascript...
2
by: JB | last post by:
Hi All, I'd like to display a "resize handle" in the bottom right corner of a form like in the windows explorer for instance (the 3 diagonal lines in the corner). Can anybody tell me how to do...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.