?
Solved

CSS Border Image Gradient

Posted on 2010-01-10
3
Medium Priority
?
2,281 Views
Last Modified: 2012-05-08
I have a CSS design problem.

I have a main content box and want to add gradient image baground as border color. Anyone that has a good guide, option, code or something to explain/show how to make that.

So instead of typical border colors using images, have gradient images (PGN)

------------
|             |
|             |
-----------

CSS Box
MainContainer




#MainContainer{
	width: 1000px;
	height: 615px;
	margin-left: auto;
    margin-right: auto;
	margin-top: -8px;

}

Open in new window

0
Comment
Question by:chugarah
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 13

Accepted Solution

by:
numberkruncher earned 1480 total points
ID: 26278374
The following gives you a gradient border and also allows you to specify the thickness.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<title>Demo Page</title>
		<style type="text/css">
			#MainContainer {
				height: 615px;
				background: white;
				margin-left: auto;
				margin-right: auto;
			}
			.gradient-border {
				width: 1000px;
				margin-left: auto;
				margin-right: auto;
				/* Border background: */
				background: #003562 url(grad.png) repeat-x top left;
				/* Border thickness: */
				padding: 3px;
			}
		</style>
	</head>
	<body>
		<div class="gradient-border">
			<div id="MainContainer">test
			</div>
		</div>
	</body>
</html>

Open in new window

grad.png
0
 
LVL 1

Author Comment

by:chugarah
ID: 26278465
:)), hehe wow, fast answer, and exactly what I was searching for. Many thanks numberkruncher.
0
 
LVL 13

Expert Comment

by:numberkruncher
ID: 26278473
No problem ;)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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 …
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
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 how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

752 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