Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

CSS corner image header styling problem

Posted on 2007-10-04
8
Medium Priority
?
331 Views
Last Modified: 2008-01-09
I have two corner images 10x20px each, one for the left and one for the right. I also have a hyperlink with text on it and basically just want to make it into a heading with the corner images and a background colour behind the hyperlink.  I have been trying to use a table for this and its just a mess. Does anyone have any ideas?
Heres what I have so far:
.homepage .mainbox_header p.leftcorner {
      background: url(../images/CurrentWebsite/rounded_left.gif) no-repeat;
      background-color: #48468D;
      height:20px;
      width:10px;
}

.homepage .mainbox_header p.rightcorner {
      background: url(../images/CurrentWebsite/rounded_right.gif) no-repeat;
      background-color: #48468D;
      height:20px;
      width:10px;
}

.homepage .mainbox_header a {
      font-family: Verdana, Arial, Helvetica, sans-serif;
      background-color: #48468D;
      font-size: 12px;
      width: 170px;
      color: #FFFFFF;
      font-weight: bold;
      text-decoration: none;
}
0
Comment
Question by:lesleyg
  • 4
  • 4
8 Comments
 
LVL 30

Expert Comment

by:VirusMinus
ID: 20013094
whats the HTML markup?

Is it divs and p's inside it? Where is the <a> tag in relation to the p's?

hard to tell without seeing it, but try the following:

* in the markup put the right corner P first followed by the left P
* add a float:right to the p.rightcorner CSS
* add a float:left to the p.leftcorner CSS
* add a display:block to the .mainbox_header a CSS
0
 

Author Comment

by:lesleyg
ID: 20013112
Hi, thanks for advice, I shall have a look to see if i can sort it...

Here is my html in the meantime

<table width="190px">
 <tr class="mainbox_header">
  <td>
   <p class="leftcorner">&nbsp;</p>
  </td>
  <td>
   <asp:HyperLink id="hlName" runat="server">HyperLink</asp:HyperLink>
  </td>
  <td>
   <p class="rightcorner">&nbsp;</p>
  </td>
 </tr>
</table>
0
 
LVL 30

Expert Comment

by:VirusMinus
ID: 20013115
could you also put up an image of what the end result should look like? and maybe the two corner images as well?

you can use www.imageshack.us to upload the images.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:lesleyg
ID: 20013164
Heres the links to the images:

http://img514.imageshack.us/img514/4650/roundedleftfs2.gif
http://img514.imageshack.us/img514/4650/roundedleftfs2.gif

I tried as you suggested above and its nearly there...only problem is gap of about 5px between each corner image and the hyperlink
0
 
LVL 30

Expert Comment

by:VirusMinus
ID: 20013212
is it like a link button?

try this and see if it helps:

get rid of the table first.

<asp:HyperLink id="hlName" runat="server">
HyperLink
<span class="leftcorner">&nbsp;</span>
<span class="rightcorner">&nbsp;</span>
</asp:HyperLink>

and then the CSS:

a#hlName{display:block;color:#fff;background
:#48486D;width:170px;height:20px;text-decoration:none}
.leftcorner, .rightcorner{position:absolute;top:0;display:block;width:10px;height:20px}
.leftcorner{left:0}
.rightcorner{right:0}
0
 

Author Comment

by:lesleyg
ID: 20013407
I havent been able to get the above to work.... I should have explained that the image will be in a datalist  which is why the whole thing is in a table.  Basically there will be 3 rows and 3 columns so a total of 9 headings in which I want the corner images and hyperlinks.  I had it nearly working as a table and with the changes you suggested:
* in the markup put the right corner P first followed by the left P
* add a float:right to the p.rightcorner CSS
* add a float:left to the p.leftcorner CSS
* add a display:block to the .mainbox_header a CSS

except for a 4 px gap between each image and the hyperlink.  I can use a -4px margin which works in firefox but doesnt in explorer.  Do you know of a way of making <td> with no margin between them?
0
 
LVL 30

Accepted Solution

by:
VirusMinus earned 2000 total points
ID: 20013494
try this:

<table cellspacing=0 cellpadding=0>
0
 

Author Comment

by:lesleyg
ID: 20013682
Great! Thanks
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Question has a verified solution.

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

This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Suggested Courses

580 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