Solved

Background image: 5px from bottom

Posted on 2009-04-10
2
275 Views
Last Modified: 2012-06-27
How can I position my background image 5px from the bottom?

I can position my background image 0px from the by using 100%

I can position my background image 5px from the top by using 5px

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<title>Title</title>

<style type="text/css" media="all">

div {

margin: auto;

width: 550px;

}
 

div p {

float: left;

width: 140px;

border: 1px solid red;

background: #ffeeee;

margin: 10px;

padding: 5px 5px 45px 5px;

background: transparent url(http://www2.hawaii.edu/~jrrosen/eportfolio/images/black.gif) no-repeat scroll 100% 100%;

}
 

</style>

</head>

<body>
 

<div>

  <p>df ads das adsf dasj das hafdsj ads afds ads fads ds hdsgdasj gsdj </p> 

  <p>dsfd gsdf sdf fds ff ads dassfd gsfsdfg fsdfdlkg jfsdkl jfsd kjsdflkfjds  adsf dasj das hafdsj ads afds ads fads ds hdsgdasj gsdj </p> 

  <p>df ads das adsf dasfdsg df gj das hafdsj ads afds ads fads ds hdsgdasj gsdj </p> 

</div>

</body>

</html>

Open in new window

0
Comment
Question by:hankknight
  • 2
2 Comments
 
LVL 2

Expert Comment

by:scarsremained
ID: 24116754
Have you tried using -5px?  I am not sure if that would work or not, I do not know much about HTML positioning.  I am going to college for Web Design, but I haven't started any of my design classes yet.
-5px would just seem like a logical choice since it would bring the image from the bottom rather than the top.  If that might not work, could you trying using different numbers like 40px from the top until you have it at the right position from the bottom? Let me know if I helped.
0
 
LVL 2

Accepted Solution

by:
scarsremained earned 500 total points
ID: 24116790
I am 90 percent sure -5px would work for you.  I was reading this at a website:
With the calc() notation from the Values and Units module [CSS3VAL], background positions can also be relative to other corners than the top left. E.g., the following puts the background image 10px from the bottom and 3em from the right:

background-position: calc(100% - 3em) calc(100% - 10px)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
css question 1 45
Adjust the position 3 45
Max-width on individual images in grid 4 51
would like the bottom of this page to be smaller 3 11
When applying CSS to your HTML, there are many different ways to select which element(s) the CSS applies to.  Some of these selectors are more commonly known and used than others - Here are the more common ones: #X - Matches an ID of X .X - Matche…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…

947 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now