How can I add an Image in Messenger Chat? - html

In my chat, I would like to have a text message displayed in the balloon for one button and an image from my gallery for the other button. The programming for the text works. How do I get this with the picture?
My HTML Code is this one:
<!DOCTYPE html>
<link rel="stylesheet" href="style.css">
<div class="Webview">
<div class="message_container" id="myForm" >
<div class="Chat_Bubble"></div>
</div>
<form class="send_container">
<input id="textField" type="text">
<img id="Bildverschicken" src="baseline_image_black_18dp.png">
<p>
<input type ="button" id="theButton" value="Nachricht absenden!"
onclick="document.getElementsByClassName('Chat_Bubble')[0].textContent=document.getElementById('textField').value"/>
</p>
<input type="button" id="Button_Bilder" value="Bild verschicken!"
onclick="document.getElementsByClassName('Chat_Bubble')[0].imageContent=document.getElementById('Bildverschicken').value"/>
<h3><div id="div"></div></h3>
</form>
</div>
Can someone help me? Thanks!

#charset "UTF-8";
.Webview{
height: 600px;
width: 380px;
}
.message_container{
height: 80%;
width: 100%;
border:5px solid green;
}
.Chat_Bubble{
box-sizing: border-box;
float: left;
width: auto;
max-width: 80%;
position: relative;
clear: both;
background: #95c2fd;
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0.15, #bee2ff), color-stop(1, #95c2fd));
background-image: -webkit-linear-gradient(bottom, #bee2ff 15%, #95c2fd 100%);
background-image: -moz-linear-gradient(bottom, #bee2ff 15%, #95c2fd 100%);
background-image: -ms-linear-gradient(bottom, #bee2ff 15%, #95c2fd 100%);
background-image: -o-linear-gradient(bottom, #bee2ff 15%, #95c2fd 100%);
background-image: linear-gradient(bottom, #bee2ff 15%, #95c2fd 100%);
border: solid 1px rgba(0,0,0,0.5);
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
border-radius: 20px;
-webkit-box-shadow: inset 0 8px 5px rgba(255,255,255,0.65), 0 1px 2px rgba(0,0,0,0.2);
-moz-box-shadow: inset 0 8px 5px rgba(255,255,255,0.65), 0 1px 2px rgba(0,0,0,0.2);
box-shadow: inset 0 8px 5px rgba(255,255,255,0.65), 0 1px 2px rgba(0,0,0,0.2);
margin-bottom: 20px;
padding: 6px 20px;
color: #000;
text-shadow: 0 1px 1px rgba(255,255,255,0.8);
word-wrap: break-word;
}
.bubble:before, .bubble:after {
border-radius: 20px / 5px;
content: '';
display: block;
position: absolute;
}
.bubble:before {
border: 10px solid transparent;
border-bottom-color: rgba(0,0,0,0.5);
bottom: 0px;
left: -7px;
z-index: -2;
}
.bubble:after {
border: 8px solid transparent;
border-bottom-color: #bee2ff; /* arrow color */
bottom: 1px;
left: -5px;
}
.bubble-alt {
float: right;
}
.bubble-alt:before {
left: auto;
right: -7px;
}
.bubble-alt:after {
left: auto;
right: -5px;
}
.bubble p {
font-size: 1.4em;
}
}
.send_container{
height: 20;
width: 100%;
}
.send_container input{
width: 70%;
height:20%
border:2px solid #1CE615;
}
.send_container button{
width: 30%;
height:20%;
}
.send_container Button_Bilder{
width: 10%;
height:10% ;
}
<!DOCTYPE html>
<link rel="stylesheet" href="style.css">
<div class="Webview">
<div class="message_container" id="myForm" >
<div class="Chat_Bubble"></div>
</div>
<form class="send_container">
<input id="textField" type="text">
<img id="Bildverschicken" src="baseline_image_black_18dp.png">
<p>
<input type ="button" id="theButton" value="Nachricht absenden!"
onclick="document.getElementsByClassName('Chat_Bubble')[0].textContent=document.getElementById('textField').value"/>
</p>
<input type="button" id="Button_Bilder" value="Bild verschicken!"
onclick="document.getElementsByClassName('Chat_Bubble')[0].imageContent=document.getElementById('Bildverschicken').value"/>
<h3><div id="div"></div></h3>
</form>
</div>

Related

How to make div elements inside a div background image responsive using css

My question is this how do I make it work that the elements that are inside a div style=background-image work correctly when the screen gets smaller. In my case it seems that one of the elements inside the image box keeps the same height.
#main_article_box {
width: 728px;
height: 374px;
border: 1px solid #f8f8f8;
-moz-box-shadow: 0 2px 1px #9c9c9c;
-webkit-box-shadow: 0 2px 1px #9c9c9c;
box-shadow: 0 2px 1px #9c9c9c;
}
#main_article_text {
margin: 280px 3px 10px 3px;
height: 90px;
background: #ffffff;
border: 1px solid #f8f8f8;
background: #ffffff;
background: -moz-linear-gradient(#ffffff, #cccccc);
background: -webkit-gradient(linear, left bottom, left top, color-stop(0, #cccccc), color-stop(1, #ffffff));
background: -webkit-linear-gradient(#ffffff, #cccccc);
background: -o-linear-gradient(#ffffff, #cccccc);
background: -ms-linear-gradient(#ffffff, #cccccc);
background: linear-gradient(#ffffff, #cccccc);
/*-moz-border-radius: 1px;
border-radius: 1px;
-moz-box-shadow: 0 1px 1px #f8f8f8;
-webkit-box-shadow: 0 1px 1px #f8f8f8;
box-shadow: 0 1px 1px #f8f8f8;*/
opacity: 0.8;
filter: alpha(opacity=80);
}
#main_article_title {
font-size: 23px;
letter-spacing: -1px;
text-transform: uppercase;
text-shadow: #333;
font-weight: bold;
margin: 8px;
}
#main_article_short_text {
font-size: 14px;
width: 530px;
font-weight: bold;
margin: -2px 0 0 8px;
color: #333333;
}
#media only screen and (max-width: 460px) {
#main_article_box {
width: 100%;
height: auto;
}
#main_article_text {
width: 98%;
height: auto;
}
#main_article_title {
font-size: 16px;
}
#main_article_short_text {
font-size: 11px;
}
}
<div id="main_article_box" style="background-image: url(http://www.watchathletics.com/data/headline/9718/rio%20usain%20bolt.jpg); no-repeat center; background-size: 100% auto; ">
<div id="main_article_text">
<div id="main_article_title">Main Article Title for this post
</div>
<div id="main_article_short_text">
<p>This is some intro text the article below title. This is some intro text the article below title.</p>...
</div>
</div>
</div>
I removed some styles only for me to understand the code. Is this solution correct for you?
.wrapper {
position:relative;
width:728px;
max-width:100%;
}
.wrapper:after {
content: ' ';
clear: both;
display: block;
}
#main_article_box {
float:left;
width:100%;
height:auto;
border:0 none;
padding-top:51.37%;
background-size:cover;
}
#main_article_text {
position: absolute;
left: 0;
right: 0;
bottom: 0;
margin: 0 3px 3px 3px;
height: 90px;
background: #ffffff;
border: 1px solid #f8f8f8;
background: #ffffff;
background: -moz-linear-gradient(#ffffff, #cccccc);
background: -webkit-gradient(linear,left bottom,left top,color-stop(0, #cccccc),color-stop(1, #ffffff));
background: -webkit-linear-gradient(#ffffff, #cccccc);
background: -o-linear-gradient(#ffffff, #cccccc);
background: -ms-linear-gradient(#ffffff, #cccccc);
background: linear-gradient(#ffffff, #cccccc);
/*-moz-border-radius: 1px;
border-radius: 1px;
-moz-box-shadow: 0 1px 1px #f8f8f8;
-webkit-box-shadow: 0 1px 1px #f8f8f8;
box-shadow: 0 1px 1px #f8f8f8;*/
opacity:0.8;
filter:alpha(opacity=80);
}
#main_article_title {
font-size: 23px;
letter-spacing: -1px;
text-transform:uppercase;
text-shadow: #333;
font-weight: bold;
margin: 8px;
}
#main_article_short_text {
font-size: 14px;
width: auto;
font-weight:bold;
margin: -2px 0 0 8px;
color: #333333;
}
#media only screen and (max-width: 460px) {
#main_article_box {
width: 100%;
height: auto;
}
#main_article_text {
width: 98%;
height: auto;
}
#main_article_title {
font-size: 16px;
}
#main_article_short_text {
font-size: 11px;
}
}
<div class="wrapper">
<div id="main_article_box" style="background-image: url(http://www.watchathletics.com/data/headline/9718/rio%20usain%20bolt.jpg);">
<div id="main_article_text">
<div id="main_article_title">Main Article Title for this post</div>
<div id="main_article_short_text"><p>This is some intro text the article below title. This is some intro text the article below title. </p>...</div>
</div>
</div>
</div>

Use DIV Containers as Flat Buttons with images inside

I want to create a button bar on top of the page, with div containers that contain images to use them as flat button. My problem is that I cannot get the alignment correctly.
Is there an additional way to highlight the last clicked button, so that you can see which button on the buttonbar is active without using javascript?
Here is my first approach:
<html>
<head>
<title>
</title>
<style>
#top {
position: fixed;
background-color: #AAA;
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(transparent));
background-image: -webkit-linear-gradient(top, #fff, transparent);
background-image: -moz-linear-gradient(top, #fff, transparent);
background-image: -o-linear-gradient(top, #fff, transparent);
background-image: linear-gradient(to bottom, #fff, transparent);
left: 0px;
top: 0px;
width: 100%;
height: 60px;
padding: 0px;
border: thin solid rgba(0,0,0,0.6);
color: #444444;
font-family: Droid sans, Arial, Helvetica, sans-serif;
font-size: 12px;
cursor: pointer;
-webkit-box-shadow: rgba(0,0,0,0.5) 3px 3px 10px;
-moz-box-shadow: rgba(0,0,0,0.5) 3px 3px 10px;
box-shadow: rgba(0,0,0,0.5) 3px 3px 10px;
}
.flatBtn2 {
height: 50px;
width: 50px;
margin-left: 5px;
margin-top: 5px;
float: left;
display: inline;
}
.flatBtn2:hover {
background-color: #eee;
height: 50px;
width: 50px;
margin-left: 5px;
margin-top: 5px;
float: left;
display: inline;
}
.buttonBar {
float:left;
}
</style>
</head>
<body>
<div id="top">
<div id="selectReiter" style="display:inline" class="buttonBar">
<div id="firstButton" class="flatBtn2" />
<div id="secondButton" class="flatBtn2" />
<div id="thirdButton" class="flatBtn2" />
</div>
</div>
</body>
</html>
#top {
position: fixed;
background-color: #AAA;
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(transparent));
background-image: -webkit-linear-gradient(top, #fff, transparent);
background-image: -moz-linear-gradient(top, #fff, transparent);
background-image: -o-linear-gradient(top, #fff, transparent);
background-image: linear-gradient(to bottom, #fff, transparent);
left: 0px;
top: 0px;
width: 100%;
height: 60px;
padding: 0px;
border: thin solid rgba(0, 0, 0, 0.6);
color: #444444;
font-family: Droid sans, Arial, Helvetica, sans-serif;
font-size: 12px;
cursor: pointer;
-webkit-box-shadow: rgba(0, 0, 0, 0.5) 3px 3px 10px;
-moz-box-shadow: rgba(0, 0, 0, 0.5) 3px 3px 10px;
box-shadow: rgba(0, 0, 0, 0.5) 3px 3px 10px;
}
.flatBtn2 {
height: 50px;
width: 50px;
margin-left: 5px;
margin-top: 5px;
float: left;
display: inline;
background-color: transparent;
border: none;
}
.flatBtn2:hover {
background-color: #eee;
height: 50px;
width: 50px;
margin-left: 5px;
margin-top: 5px;
float: left;
display: inline;
}
.flatBtn2:focus {
background-color: #eee;
}
.buttonBar {
float: left;
}
<div id="top">
<div id="selectReiter" style="display:inline" class="buttonBar">
<button id="firstButton" class="flatBtn2" >Button 1</button>
<button id="secondButton" class="flatBtn2" >Button 2</button>
<a id="thirdButton" href="#" class="flatBtn2">A 3</a>
</div>
</div>
First of all if you want to use button, then you should you the <button> tag and add the background image through css. You can also manipulate the states in css, what you are seacrhing for is :focus and :active, so you have two rules for your buttons. The normal button rule with the main background-image and an other rule button:focus, button:active where you can load an other image or do something else.
See fiddle for a working example. I added the needed styles at the end of your css.
Hope this helps!

Issue with the background and z-index

Here's the code that works the right way only if you remove background: #a1a1a1; from the .sign-up form. But I need the background. Changing z-index doesn't help since -1 value is too small and 0 is to big.
How to fix this problem?
Thank You.
.sign-up__form {
width: 260px;
padding: 20px;
background: #fff;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
border-top: 5px solid #ff4e50;
top: 80px;
left: 0;
right: 0;
margin: auto;
position: absolute;
}
.register-switch {
height: 32px;
margin-bottom: 20px;
padding: 4px;
position: relative;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
.register-switch-input {
display: none;
}
.register-switch-label {
float: left;
width: 50%;
line-height: 32px;
color: #fff;
text-align: center;
cursor: pointer;
}
.register-switch-label:after {
position: absolute;
content: "";
width: 100%;
height: 100%;
background: lightblue;
left: 0;
top: 0;
z-index: -1;
}
.register-switch-input:checked + .register-switch-label:after {
background: tomato;
}
.register-switch-input:checked + .register-switch-label {
font-weight: normal;
color: #666;
background: #fff;
border-radius: 2px;
background-image: -webkit-linear-gradient(top, #fefefe, #eeeeee);
background-image: -moz-linear-gradient(top, #fefefe, #eeeeee);
background-image: -o-linear-gradient(top, #fefefe, #eeeeee);
background-image: linear-gradient(to bottom, #fefefe, #eeeeee);
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.1);
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.1);
}
<form name="sign-up" class="sign-up__form">
<div class="register-switch">
<input type="radio" name="sex" value="Male" id="sex-m" class="register-switch-input" checked>
<label for="sex-m" class="register-switch-label">Male</label>
<input type="radio" name="sex" value="Female" id="sex-f" class="register-switch-input">
<label for="sex-f" class="register-switch-label">Female</label>
</div>
</form>
You need to set a z-index on the .sign-up__form rule as well ..
.sign-up__form {
width: 260px;
padding: 20px;
background: #fff;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
border-top: 5px solid #ff4e50;
top: 80px;
left: 0;
right: 0;
margin: auto;
position: absolute;
z-index: -1;
}
.register-switch {
height: 32px;
margin-bottom: 20px;
padding: 4px;
position: relative;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
.register-switch-input {
display: none;
}
.register-switch-label {
float: left;
width: 50%;
line-height: 32px;
color: #fff;
text-align: center;
cursor: pointer;
}
.register-switch-label:after {
position: absolute;
content: "";
width: 100%;
height: 100%;
background: lightblue;
left: 0;
top: 0;
z-index: -1;
border-radius: 5px;
}
.register-switch-input:checked + .register-switch-label:after {
background: tomato;
}
.register-switch-input:checked + .register-switch-label {
font-weight: normal;
color: #666;
background: #fff;
border-radius: 2px;
background-image: -webkit-linear-gradient(top, #fefefe, #eeeeee);
background-image: -moz-linear-gradient(top, #fefefe, #eeeeee);
background-image: -o-linear-gradient(top, #fefefe, #eeeeee);
background-image: linear-gradient(to bottom, #fefefe, #eeeeee);
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.1);
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.1);
}
<form name="sign-up" class="sign-up__form">
<div class="register-switch">
<input type="radio" name="sex" value="Male" id="sex-m" class="register-switch-input" checked>
<label for="sex-m" class="register-switch-label">Male</label>
<input type="radio" name="sex" value="Female" id="sex-f" class="register-switch-input">
<label for="sex-f" class="register-switch-label">Female</label>
</div>
</form>

css - div background color not showing

I am trying to make the background color of the div: content2 the same as that of div: sidebar. However the background color does not show for content2 but it does for sidebar.
Also i am trying to make the header and footer bars transparent but it does not seem to work.
This is my css code
body {
background-image: url('background.jpg');
background-size: 100% 100%;
padding: 0px 0px 0px 0px;
font-size: 13px;
position: relative;
min-height: 400px;
}
#footer {
float: left;
height: 20px;
width: 100%;
border: 1px solid black;
text-align: center;
padding: 30px 0px 20px 0px;
border-radius: 24px;
-webkit-border-radius: 24px;
-moz-border-radius: 24px;
box-shadow: 2px 2px 3px #666666;
-webkit-box-shadow: 2px 2px 3px #666666;
-moz-box-shadow: 2px 2px 3px #666666;
background: #8B8B8B;
background: linear-gradient(top, #A9A9A9, #7A7A7A);
background: -ms-linear-gradient(top, #A9A9A9, #7A7A7A);
background: -webkit-gradient(linear, left top, left bottom, from(#A9A9A9), to(#7A7A7A));
background: -moz-linear-gradient(top, #A9A9A9, #7A7A7A);
border: solid 1px #6D6D6D;
position:relative;
z-index:999;
//transparency
opacity: 0.6;
filter: alpha(opacity=60); /* For IE8 and earlier */
}
#content2 { //sign in page
background-color: #EEE;
float: left;
margin: 38px 20px 38px 200px;
height: 370px;
width: 550px;
border: 1px solid black;
padding: 15px;
padding-top: 20px;
font-size: 18px;
}
#sidebar {
background-color: #EEE;
float: left;
margin: 38px 200px 38px 20px;
height: 300px;
width: 250px;
border: 1px solid black;
padding: 15px;
}
#menucontainer{
width: 79.5%;
text-align: center;
margin: 0px 0px 0px 0px;
padding: 6px 6px 4px 270px;
height: 60px;
line-height: 25px;
border-radius: 24px;
-webkit-border-radius: 24px;
-moz-border-radius: 24px;
box-shadow: 2px 2px 3px #666666;
-webkit-box-shadow: 2px 2px 3px #666666;
-moz-box-shadow: 2px 2px 3px #666666;
background: #8B8B8B;
background: linear-gradient(top, #A9A9A9, #7A7A7A);
background: -ms-linear-gradient(top, #A9A9A9, #7A7A7A);
background: -webkit-gradient(linear, left top, left bottom, from(#A9A9A9), to(#7A7A7A));
background: -moz-linear-gradient(top, #A9A9A9, #7A7A7A);
border: solid 1px #6D6D6D;
z-index:999;
}
#menu-bar {
width: 624px;
margin-left: auto;
margin-right: auto;
height: 395px;
}
And this is my html code
<div id="menucontainer">
<ul id="menu-bar">
menu
</ul>
</div>
<div id="content2">
content 2
</div>
<div id="sidebar">
side bar
</div>
<div id="footer">
footer
</div>
</body>
Can anyone please help me with this? Thanks
It's because you used the // to comment a single line in CSS. You can just use the pair /* and */ to comment in CSS. So all the following CSS is discarded. Check this Demo
replace comment "//sign in page" with "/*sign in page */" .
add opacity in header and footer div #footer and #menucontainer
#menucontainer {
opacity: 0.5;
}
or change in background style code like this
#menucontainer {
background: -webkit-gradient(linear, left top, left bottom, from(rgba(169, 169, 169, 0.8)), to(rgba(124, 124, 124, 0.8)));
background: -moz-linear-gradient(top, rgba(169, 169, 169, 0.8), rgba(124, 124, 124, 0.8) ); }
and for background in content 2 add background property in class #content2
#content2 {
float: left;
margin: 38px 20px 38px 200px;
height: 370px;
width: 550px;
border: 1px solid black;
padding: 15px;
padding-top: 20px;
font-size: 18px;
background: #ccc;
}
and delete those things from your code
//transparency
//sign in page
the // is valid only if you are writing and .scss file (sass), that's usually the comment syntax for javascript also.
the standard css comment syntax is /* your comment here */
It is working correctly.
But the thing is comments inside style tag should be done through this fashion /* -- */
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
body {
background-image: url('background.jpg');
background-size: 100% 100%;
padding: 0px 0px 0px 0px;
font-size: 13px;
position: relative;
min-height: 400px;
}
#footer {
float: left;
height: 20px;
width: 100%;
border: 1px solid black;
text-align: center;
padding: 30px 0px 20px 0px;
border-radius: 24px;
-webkit-border-radius: 24px;
-moz-border-radius: 24px;
box-shadow: 2px 2px 3px #666666;
-webkit-box-shadow: 2px 2px 3px #666666;
-moz-box-shadow: 2px 2px 3px #666666;
background: #8B8B8B;
background: linear-gradient(top, #A9A9A9, #7A7A7A);
background: -ms-linear-gradient(top, #A9A9A9, #7A7A7A);
background: -webkit-gradient(linear, left top, left bottom, from(#A9A9A9), to(#7A7A7A));
background: -moz-linear-gradient(top, #A9A9A9, #7A7A7A);
border: solid 1px #6D6D6D;
position:relative;
z-index:999;
/*transparency*/
opacity: 0.6;
filter: alpha(opacity=60); /* For IE8 and earlier */
}
#content2 {
background-color: #EEE;
float: left;
margin: 38px 20px 38px 200px;
height: 370px;
width: 550px;
border: 1px solid black;
padding: 15px;
padding-top: 20px;
font-size: 18px;
}
#sidebar {
background-color: #EEE;
float: left;
margin: 38px 200px 38px 20px;
height: 300px;
width: 250px;
border: 1px solid black;
padding: 15px;
}
#menucontainer{
width: 79.5%;
text-align: center;
margin: 0px 0px 0px 0px;
padding: 6px 6px 4px 270px;
height: 60px;
line-height: 25px;
border-radius: 24px;
-webkit-border-radius: 24px;
-moz-border-radius: 24px;
box-shadow: 2px 2px 3px #666666;
-webkit-box-shadow: 2px 2px 3px #666666;
-moz-box-shadow: 2px 2px 3px #666666;
background: #8B8B8B;
background: linear-gradient(top, #A9A9A9, #7A7A7A);
background: -ms-linear-gradient(top, #A9A9A9, #7A7A7A);
background: -webkit-gradient(linear, left top, left bottom, from(#A9A9A9), to(#7A7A7A));
background: -moz-linear-gradient(top, #A9A9A9, #7A7A7A);
border: solid 1px #6D6D6D;
z-index:999;
}
#menu-bar {
width: 624px;
margin-left: auto;
margin-right: auto;
height: 395px;
}
</style>
</head>
<body>
<div id="menucontainer">
<ul id="menu-bar">
menu
</ul>
</div>
<div id="content2">
content 2
</div>
<div id="sidebar">
side bar
</div>
<div id="footer">
footer
</div>
</body>
</html>
JS Fiddle:
http://jsfiddle.net/zRS84/

How to Style an hr Tag Using CSS and HTML?

How can I style an hr tag?
#footer hr
{
background-image: -moz-linear-gradient(left, rgba(0,0,0,0), rgba(0,0,0,0.75), rgba(0,0,0,0));
}
This doesn't work in firefox. I even tried background:, but that didn't work. Is there some other way to make it work?
Its working
you need to just use hr in div with your css id footer. As like below
<div id="footer">
<hr />
</div>
Try background: instead of background-image:
See here for a working example in Firefox:
http://playground.genelocklin.com/gradient-hr/
You need to specify the height of the <hr />
look this
Well, you could try making a div like so:
CSS:
div.hr{
background-image:url('yourimage.jpg');
height: 5px;
width: 400px; /*About the size of the content area that you are putting it in*/
margin-left: auto;
margin-right: auto;
}
HTML:
<div id="hr">
</div>
Have any questions?
EDIT:
With taking a look at Charlie's answers, you could try something like this:
<div id="footer">
<hr id="footer" />
</div>
#footer
{
height:10px;
background-color: black;
padding: 0px
}
.myhr {
border: 0;
height: 1px;
background: #333;
background-image: -webkit-linear-gradient(left, #ccc, #333, #ccc);
background-image: -moz-linear-gradient(left, #ccc, #333, #ccc);
background-image: -ms-linear-gradient(left, #ccc, #333, #ccc);
background-image: -o-linear-gradient(left, #ccc, #333, #ccc);
}
hrshadow {
height: 12px;
border: 0;
box-shadow: inset 0 12px 12px -12px rgba(0,0,0,0.5);
}
/****************************/
Newhr {
height: 30px;
border-style: solid;
border-color: black;
border-width: 1px 0 0 0;
border-radius: 20px;
}
Newhr:before {
display: block;
content: "";
height: 30px;
margin-top: -31px;
border-style: solid;
border-color: black;
border-width: 0 0 1px 0;
border-radius: 20px;
}
.hrstyle {
padding: 0;
border: none;
border-top: medium double #333;
color: #333;
text-align: center;
}
.hrstyle:after {
content: "ยง";
display: inline-block;
position: relative;
top: -0.7em;
font-size: 1.5em;
padding: 0 0.25em;
background: white;
}
/****dashed line *****/
.dash_hr {
border: 0;
border-bottom: 1px dashed #ccc;
background: #999;
}