Solved

CSS - Yet another rounded corner question

Posted on 2009-04-04
8
231 Views
Last Modified: 2012-06-21
I know about Nifty Corners, et al. But ... can anyone tell me how to get this same effect of an expandable height box using images top and bottom and repeating for the main content area, that does not use a table for the content. I can't find a way to create space between the box edges and still get the background image to repeat all the way down, other than a table. Would love to see a table-less solution. Mine is not very elegant.
/* Relevant CSS From External Style Sheet   */
 

.rounded_corner_bottom {margin-top:0px;}

.copy table .first_col {padding:5px 4%;width:3%;}

.copy table .second_col {padding:5px 2% 5px 1%;width:94%; text-align:left;}

.copy table .button_row {padding:10px 6% 10px 1%;width:94%; text-align:right;}
 

.copy .radiotop {margin-bottom:0px;*margin-bottom:0;}

.copy .workshopicon {float:left; padding: 0 30px 8px 0; margin: -10px 0 0 0px;}

.copy .steelbluebody {background: url(../Images/Boxes/SteelBlue/1px.png) repeat-y; width: 478px;}
 
 
 

/* HTML for box   */
 

<div class="radiotop"><img src="../../../Assets/Images/Boxes/SteelBlue/top.png" /></div>
 

<table class="steelbluebody">

    <tr>

        <td class="first_col">&nbsp;</td>

        <td class="second_col"><p>Once you decide that the Snider Investment Method is right for you, you can choose one of two ways to learn the method.<br /><br />
 

                You can take a live, two-day workshop or you can take a self-paced online class.<br /><br />

                

                Both classes cover the same information and offer the same materials and support services. We know that different people like to learn in different ways, so the choice is yours.

                </p>

         </td>

    </tr>

    <tr>

        <td class="first_col">&nbsp;</td>

        <td class="button_row"><a href="#live"><img src="../../../Assets/Images/Icons/info.png" /></a></td>

    </tr>        

</table>
 

<div class="rounded_corner_bottom"><img src="../../../Assets/Images/Boxes/SteelBlue/bottom.png" /></div>
 
 
 

/* Page link   */
 

Can' show you a live page yet. Example of what it looks like is attached as file. Thanks

Open in new window

SIM-signups.pdf
0
Comment
Question by:ksnider
  • 4
  • 3
8 Comments
 
LVL 11

Expert Comment

by:level9wizard
ID: 24069879
Try experimenting with 'position: absolute' and use 'left/right' and 'top/bottom' to place these divs. Remember, position absolute is based on the containing div (the parent div) so to treat it properly based on the container, the parent should be position:relative;
0
 
LVL 42

Accepted Solution

by:
David S. earned 200 total points
ID: 24070226
0
 

Author Comment

by:ksnider
ID: 24071587
Thanks guys. I am going to play with this this afternoon. I think what is messing me up is using a 1 pixel image as the body of the box. If I used a background color and border, then I could use padding. The background image stops at the padding. I'll let you know and award points. Thanks for your responses.
0
 

Author Comment

by:ksnider
ID: 24079247
So ... I guess what I was really asking, was how to put text over a background image without using a table. The answer talks about using a background color, which I understand. But is there a way to put text over a background image, so that it doesn't run to the edge of the image, without using a table to do it?
0
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.

 
LVL 42

Expert Comment

by:David S.
ID: 24079487
Sure. Just use padding to push the text away from the edges of the box.
0
 

Author Comment

by:ksnider
ID: 24079760
Kravimir- When I use padding, it pushes the background image too.
0
 
LVL 42

Expert Comment

by:David S.
ID: 24079780
It sounds like you're adding the padding to an ancestor of the element with the background image.
0
 

Author Comment

by:ksnider
ID: 24079787
Hmmm. OK, let me try again and get back to you. If I can't get it to work, I'll put the code in so you can tell me what I am doing wrong, if you don't mind.
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
Button Css BootStrap 2 35
html form to write data to csv 24 97
Full Screen problem when auto scale IFRAME 2 65
How to avoid jquery conflicts in Wordpress ? 4 24
This article discusses how to create an extensible mechanism for linked drop downs.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

895 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

14 Experts available now in Live!

Get 1:1 Help Now