Related
I'm modifying some CSS/HTML that I found here that displays a iOS style chat message with bubbles. I wanted to swap the alignment of the blue and green bubbles which I've managed to do but the only thing I'm not sure about is how to change the little "handle" that appears in the bottom left and right corners around as well.
Here's how it currently looks:
/* Bit of normalisation */
body {
background-color: #eee;
color: #222;
font: 0.8125em/1.5 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
img {
display: block;
height: auto;
max-width: 100%;
}
.container {
padding: 40px 20px;
margin: 0 auto;
width: 400px;
}
/* .bubble */
.bubble {
background-image: linear-gradient(bottom, rgb(210,244,254) 25%, rgb(149,194,253) 100%);
background-image: -o-linear-gradient(bottom, rgb(210,244,254) 25%, rgb(149,194,253) 100%);
background-image: -moz-linear-gradient(bottom, rgb(210,244,254) 25%, rgb(149,194,253) 100%);
background-image: -webkit-linear-gradient(bottom, rgb(210,244,254) 25%, rgb(149,194,253) 100%);
background-image: -ms-linear-gradient(bottom, rgb(210,244,254) 25%, rgb(149,194,253) 100%);
background-image: -webkit-gradient(
linear,
left bottom,
left top,
color-stop(0.25, rgb(210,244,254)),
color-stop(1, rgb(149,194,253))
);
border: solid 1px rgba(0, 0, 0, 0.5);
/* vendor rules */
border-radius: 20px;
/* vendor rules */
box-shadow: inset 0 5px 5px rgba(255, 255, 255, 0.4), 0 1px 3px rgba(0, 0, 0, 0.2);
/* vendor rules */
box-sizing: border-box;
clear: both;
float: right;
margin-bottom: 20px;
padding: 8px 30px;
position: relative;
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
width: auto;
max-width: 100%;
word-wrap: break-word;
}
.bubble:before, .bubble:after {
border-radius: 20px / 10px;
content: '';
display: block;
position: absolute;
}
.bubble:before {
border: 10px solid transparent;
border-bottom-color: rgba(0, 0, 0, 0.5);
bottom: 0;
left: -7px;
z-index: -2;
}
.bubble:after {
border: 8px solid transparent;
border-bottom-color: #d2f4fe;
bottom: 1px;
left: -5px;
}
.bubble--alt {
background-image: linear-gradient(bottom, rgb(172,228,75) 25%, rgb(122,205,71) 100%);
background-image: -o-linear-gradient(bottom, rgb(172,228,75) 25%, rgb(122,205,71) 100%);
background-image: -moz-linear-gradient(bottom, rgb(172,228,75) 25%, rgb(122,205,71) 100%);
background-image: -webkit-linear-gradient(bottom, rgb(172,228,75) 25%, rgb(122,205,71) 100%);
background-image: -ms-linear-gradient(bottom, rgb(172,228,75) 25%, rgb(122,205,71) 100%);
background-image: -webkit-gradient(
linear,
left bottom,
left top,
color-stop(0.25, rgb(172,228,75)),
color-stop(1, rgb(122,205,71))
);
float: left;
}
.bubble--alt:before {
border-bottom-color: rgba(0, 0, 0, 0.5);
border-radius: 20px / 10px;
left: auto;
right: -7px;
}
.bubble--alt:after {
border-bottom-color: #ace44b;
border-radius: 20px / 10px;
left: auto;
right: -5px;
}
<div class="container">
<div class="bubble">
Blue text bubble
</div>
<div class="bubble bubble--alt">
Green text bubble
</div>
<div class="bubble">
A bubble containing lots and lots and lots and lots of content on multiple lines
</div>
<div class="bubble bubble--alt">
Bubble with image
<img src="http://placekitten.com/800/600" alt="" />
</div>
<div class="bubble">
Bubblewitharidiculouslylongwordwhichwrapseffortlesslyontotwolines
</div>
</div>
I can't work out how to swap the little handles in the bottom corners of each bubble so they are on the opposite side. I'd like the blue one appear from the bottom right corner and the green one appearing from the bottom left corner.
Here you go full code:
Under .bubble:before{..} and .bubble:after {..} you have used left property that should be of right and vice-versa for 'bubble--alt:before{..}andbubble--alt:after{..}`.
body {
background-color: #eee;
color: #222;
font: 0.8125em/1.5 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
img {
display: block;
height: auto;
max-width: 100%;
}
.container {
padding: 40px 20px;
margin: 0 auto;
width: 400px;
}
/* .bubble */
.bubble {
background-image: linear-gradient(bottom, rgb(210, 244, 254) 25%, rgb(149, 194, 253) 100%);
background-image: -o-linear-gradient(bottom, rgb(210, 244, 254) 25%, rgb(149, 194, 253) 100%);
background-image: -moz-linear-gradient(bottom, rgb(210, 244, 254) 25%, rgb(149, 194, 253) 100%);
background-image: -webkit-linear-gradient(bottom, rgb(210, 244, 254) 25%, rgb(149, 194, 253) 100%);
background-image: -ms-linear-gradient(bottom, rgb(210, 244, 254) 25%, rgb(149, 194, 253) 100%);
background-image: -webkit-gradient( linear, right bottom, right top, color-stop(0.25, rgb(210, 244, 254)), color-stop(1, rgb(149, 194, 253)));
border: solid 1px rgba(0, 0, 0, 0.5);
/* vendor rules */
border-radius: 20px;
/* vendor rules */
box-shadow: inset 0 5px 5px rgba(255, 255, 255, 0.4), 0 1px 3px rgba(0, 0, 0, 0.2);
/* vendor rules */
box-sizing: border-box;
clear: both;
float: right;
margin-bottom: 20px;
padding: 8px 30px;
position: relative;
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
width: auto;
max-width: 100%;
word-wrap: break-word;
}
.bubble:before,
.bubble:after {
border-radius: 20px / 10px;
content: '';
display: block;
position: absolute;
}
.bubble:before {
border: 10px solid transparent;
border-bottom-color: rgba(0, 0, 0, 0.5);
bottom: 0;
right: -7px;
z-index: -2;
}
.bubble:after {
border: 8px solid transparent;
border-bottom-color: #d2f4fe;
bottom: 1px;
right: -5px;
}
.bubble--alt {
background-image: linear-gradient(bottom, rgb(172, 228, 75) 25%, rgb(122, 205, 71) 100%);
background-image: -o-linear-gradient(bottom, rgb(172, 228, 75) 25%, rgb(122, 205, 71) 100%);
background-image: -moz-linear-gradient(bottom, rgb(172, 228, 75) 25%, rgb(122, 205, 71) 100%);
background-image: -webkit-linear-gradient(bottom, rgb(172, 228, 75) 25%, rgb(122, 205, 71) 100%);
background-image: -ms-linear-gradient(bottom, rgb(172, 228, 75) 25%, rgb(122, 205, 71) 100%);
background-image: -webkit-gradient( linear, left bottom, left top, color-stop(0.25, rgb(172, 228, 75)), color-stop(1, rgb(122, 205, 71)));
float: left;
}
.bubble--alt:before {
border-bottom-color: rgba(0, 0, 0, 0.5);
border-radius: 20px / 10px;
right: auto;
left: -7px;
}
.bubble--alt:after {
border-bottom-color: #ace44b;
border-radius: 20px / 10px;
right: auto;
left: -5px;
}
<div class="container">
<div class="bubble">
Blue text bubble
</div>
<div class="bubble bubble--alt">
Green text bubble
</div>
<div class="bubble">
A bubble containing lots and lots and lots and lots of content on multiple lines
</div>
<div class="bubble bubble--alt">
Bubble with image
<img src="http://placekitten.com/800/600" alt="" />
</div>
<div class="bubble">
Bubblewitharidiculouslylongwordwhichwrapseffortlesslyontotwolines
</div>
</div>
Updated your code. Is this what you want?
/* Bit of normalisation */
body {
background-color: #eee;
color: #222;
font: 0.8125em/1.5 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
img {
display: block;
height: auto;
max-width: 100%;
}
.container {
padding: 40px 20px;
margin: 0 auto;
width: 400px;
}
/* .bubble */
.bubble {
background-image: linear-gradient(bottom, rgb(210,244,254) 25%, rgb(149,194,253) 100%);
background-image: -o-linear-gradient(bottom, rgb(210,244,254) 25%, rgb(149,194,253) 100%);
background-image: -moz-linear-gradient(bottom, rgb(210,244,254) 25%, rgb(149,194,253) 100%);
background-image: -webkit-linear-gradient(bottom, rgb(210,244,254) 25%, rgb(149,194,253) 100%);
background-image: -ms-linear-gradient(bottom, rgb(210,244,254) 25%, rgb(149,194,253) 100%);
background-image: -webkit-gradient(
linear,
left bottom,
left top,
color-stop(0.25, rgb(210,244,254)),
color-stop(1, rgb(149,194,253))
);
border: solid 1px rgba(0, 0, 0, 0.5);
/* vendor rules */
border-radius: 20px;
/* vendor rules */
box-shadow: inset 0 5px 5px rgba(255, 255, 255, 0.4), 0 1px 3px rgba(0, 0, 0, 0.2);
/* vendor rules */
box-sizing: border-box;
clear: both;
float: right;
margin-bottom: 20px;
padding: 8px 30px;
position: relative;
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
width: auto;
max-width: 100%;
word-wrap: break-word;
}
.bubble:before, .bubble:after {
border-radius: 20px / 10px;
content: '';
display: block;
position: absolute;
}
.bubble:before {
border: 10px solid transparent;
border-bottom-color: rgba(0, 0, 0, 0.5);
bottom: 0;
right: -7px;
z-index: -2;
}
.bubble:after {
border: 8px solid transparent;
border-bottom-color: #d2f4fe;
bottom: 1px;
right: -5px;
}
.bubble--alt {
background-image: linear-gradient(bottom, rgb(172,228,75) 25%, rgb(122,205,71) 100%);
background-image: -o-linear-gradient(bottom, rgb(172,228,75) 25%, rgb(122,205,71) 100%);
background-image: -moz-linear-gradient(bottom, rgb(172,228,75) 25%, rgb(122,205,71) 100%);
background-image: -webkit-linear-gradient(bottom, rgb(172,228,75) 25%, rgb(122,205,71) 100%);
background-image: -ms-linear-gradient(bottom, rgb(172,228,75) 25%, rgb(122,205,71) 100%);
background-image: -webkit-gradient(
linear,
left bottom,
left top,
color-stop(0.25, rgb(172,228,75)),
color-stop(1, rgb(122,205,71))
);
float: left;
}
.bubble--alt:before {
border-bottom-color: rgba(0, 0, 0, 0.5);
border-radius: 20px / 10px;
right: auto;
left: -7px;
}
.bubble--alt:after {
border-bottom-color: #ace44b;
border-radius: 20px / 10px;
right: auto;
left: -5px;
}
<div class="container">
<div class="bubble">
Blue text bubble
</div>
<div class="bubble bubble--alt">
Green text bubble
</div>
<div class="bubble">
A bubble containing lots and lots and lots and lots of content on multiple lines
</div>
<div class="bubble bubble--alt">
Bubble with image
<img src="http://placekitten.com/800/600" alt="" />
</div>
<div class="bubble">
Bubblewitharidiculouslylongwordwhichwrapseffortlesslyontotwolines
</div>
</div>
so far I have this < hr > with the About Me text in a data-content.
I want to add a linear gradient border bottom with three colors under the text "About Me" like it is underlined. I've tried setting the background in the .section-divider:after to a linear gradient and padding and all that but it ends up setting the whole background as a linear gradient.
HTML:
<hr class="section-divider" data-content="ABOUT ME"></hr>
CSS:
.section-divider {
font-family: Lato-Regular;
line-height: 1em;
position: relative;
outline: 0;
border: 0;
color: black;
text-align: left;
height: 1.5em;
font-size: 20px;
}
.section-divider:before {
content: '';
background: black;
position: absolute;
left: 0;
top: 50%;
width: 100%;
height: 1px;
}
.section-divider:after {
content: attr(data-content);
position: relative;
display: inline-block;
color: black;
padding: 0 .5em;
line-height: 1.5em;
color: black;
background-color: white;
}
If anyone knows how to do this or a better way to do this hr with text aligned to the left better in general let me know, thank you!
.section-divider {
font-family: Lato-Regular;
line-height: 1em;
position: relative;
outline: 0;
border: 0;
color: black;
text-align: left;
height: 1.5em;
font-size: 20px;
}
.section-divider:before {
content: '';
background: black;
position: absolute;
left: 0;
top: 50%;
width: 100%;
height: 1px;
}
.section-divider:after {
content: attr(data-content);
position: relative;
display: inline-block;
color: black;
padding: 0 .5em;
line-height: 1.5em;
color: black;
background-color: white;
}
<hr class="section-divider" data-content="ABOUT ME"></hr>
You can use this code.
.section-divider {
font-family: Lato-Regular;
line-height: 1em;
position: relative;
outline: 0;
border: 0;
color: black;
text-align: left;
height: 1.5em;
font-size: 20px;
}
.section-divider:before {
content: '';
position: absolute;
left: 0;
top: 50%;
width: 100%;
height: 1px;
margin: 0;
border: 0;
background: #333; /* Chrome,Safari4+ */
background: -webkit-gradient(linear, left top, right top, color-stop(0%,#34495e), color-stop(10%,#34495e), color-stop(10%,#207cca), color-stop(24%,#2989d8), color-stop(24%,#34495e), color-stop(42%,#34495e), color-stop(42%,#207cca), color-stop(70%,#207cca), color-stop(70%,#207cca), color-stop(70%,#34495e), color-stop(100%,#34495e)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(left, #34495e 0%,#34495e 10%,#207cca 10%,#2989d8 24%,#34495e 24%,#34495e 42%,#207cca 42%,#207cca 70%,#207cca 70%,#34495e 70%,#34495e 100%); /* Chrome10+,Safari5.1+ */
background-image: -moz-linear-gradient(left, #34495e 0%, #34495e 9%, #207cca 10%, #2989d8 24%, #34495e 24%, #34495e 42%, #207cca 42%, #207cca 70%, #207cca 70%, #34495e 71%, #34495e 100%);
background-image: -o-linear-gradient(left, #34495e 0%, #34495e 9%, #207cca 10%, #2989d8 24%, #34495e 24%, #34495e 42%, #207cca 42%, #207cca 70%, #207cca 70%, #34495e 71%, #34495e 100%);
background-image: linear-gradient(left, #34495e 0%, #34495e 9%, #207cca 10%, #2989d8 24%, #34495e 24%, #34495e 42%, #207cca 42%, #207cca 70%, #207cca 70%, #34495e 71%, #34495e 100%); /* Chrome10+,Safari5.1+ */
}
.section-divider:after {
content: attr(data-content);
position: relative;
display: inline-block;
color: black;
padding: 0 .5em;
line-height: 1.5em;
color: black;
background-color: white;
}
<hr class="section-divider" data-content="ABOUT ME" />
I have a menu that is working fine, but I want put a new sublevel on it, and if I put directly, when new options show they hide the othes option of menu.
here a pic http://www.potrusmaximus.uphero.com/dudas/menu.jpg
I want that new options show it next to the selected not down.
thx
Here my css and Html.
#menu-bar {
display: inline-block;
}
html[xmlns] #menu-bar {
display: block;
}
* html #menu-bar {
height: 1%;
}
#menu-bar {
width: 1010px;
margin: 3px 0px 0px 0px;
padding: 0px 5px 5px 5px !important;
max-height: 42px;
line-height: 100%;
border-radius: 43px;
-webkit-border-radius: 43px;
-moz-border-radius: 43px;
box-shadow: 2px 2px 14px #949494;
-webkit-box-shadow: 2px 2px 14px #949494;
-moz-box-shadow: 2px 2px 14px #949494;
background: #f7f7f7;
background: -moz-linear-gradient(top, #f7f7f7 0%, #c4c4c4 16%, #666666 39%, #666666 56%, #545454 68%, #292929 100%);
background: -webkit-gradient(left top, left bottom, color-stop(0%, #f7f7f7), color-stop(16%, #c4c4c4), color-stop(39%, #666666), color-stop(56%, #666666), color-stop(68%, #545454), color-stop(100%, #292929));
background: -webkit-linear-gradient(top, #f7f7f7 0%, #c4c4c4 16%, #666666 39%, #666666 56%, #545454 68%, #292929 100%);
background: -o-linear-gradient(top, #f7f7f7 0%, #c4c4c4 16%, #666666 39%, #666666 56%, #545454 68%, #292929 100%);
background: -ms-linear-gradient(top, #f7f7f7 0%, #c4c4c4 16%, #666666 39%, #666666 56%, #545454 68%, #292929 100%);
background: linear-gradient(to bottom, #f7f7f7 0%, #c4c4c4 16%, #666666 39%, #666666 56%, #545454 68%, #292929 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr="#f7f7f7", endColorstr="#292929", GradientType=0 );
border: solid 2px #B8B8B8;
position:relative;
z-index:999;
}
#menu-bar li { /* define los li*/
margin: 0px 8px 6px 8px;
padding: 0px 18px 0px 17px !important;
float: left;
position: relative;
list-style: none;
}
#menu-bar a { /*define los enlace*/
font-weight: bolder;
font-family: georgia;
font-style: normal;
font-size: 15px;
color: #EDEBEB;
text-decoration: none;
display: block;
padding: 15px 10px 10px 10px !important;
margin-bottom: 6px;
border-radius: 29px;
-webkit-border-radius: 29px;
-moz-border-radius: 29px;
text-shadow: 2px 2px 3px #000000;
}
#menu-bar li ul li a {
margin: 0;
}
/*#menu-bar .active a, */#menu-bar li:hover > a {
background: #ffffff;
background: -moz-radial-gradient(center, ellipse cover, #ffffff 0%, #ffffff 18%, #ebe8eb 32%, #d2d0d2 51%, #9a989a 74%, #434243 100%);
background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%, #ffffff), color-stop(18%, #ffffff), color-stop(32%, #ebe8eb), color-stop(51%, #d2d0d2), color-stop(74%, #9a989a), color-stop(100%, #434243));
background: -webkit-radial-gradient(center, ellipse cover, #ffffff 0%, #ffffff 18%, #ebe8eb 32%, #d2d0d2 51%, #9a989a 74%, #434243 100%);
background: -o-radial-gradient(center, ellipse cover, #ffffff 0%, #ffffff 18%, #ebe8eb 32%, #d2d0d2 51%, #9a989a 74%, #434243 100%);
background: -ms-radial-gradient(center, ellipse cover, #ffffff 0%, #ffffff 18%, #ebe8eb 32%, #d2d0d2 51%, #9a989a 74%, #434243 100%);
background: radial-gradient(ellipse at center, #ffffff 0%, #ffffff 18%, #ebe8eb 32%, #d2d0d2 51%, #9a989a 74%, #434243 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr="#ffffff", endColorstr="#434243", GradientType=1 );
color: #141414;
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
-moz-box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
text-shadow: 2px 2px 3px #363636;
}
#menu-bar ul li:hover a, #menu-bar li:hover li a { /* coplores iluminacion*/
background: none;
border: none;
color: #ebebeb;
-box-shadow: none;
-webkit-box-shadow: none;
-moz-box-shadow: none;
}
#menu-bar ul a:hover { /*elementos submenu seleccionados*/
background: #0399D4 !important;
background: linear-gradient(top, #87ECEC, #0186BA) !important;
background: -ms-linear-gradient(top, #87ECEC, #0186BA) !important;
background: -webkit-gradient(linear, left top, left bottom, from(#87ECEC), to(#0186BA)) !important;
background: -moz-linear-gradient(top, #87ECEC, #0186BA) !important;
color: #141414 !important;
border-radius: 29px;
-webkit-border-radius: 0;
-moz-border-radius: 0;
text-shadow: 2px 2px 3px #FFFFFF;
}
#menu-bar ul { /*define la caja del submenu*/
background: #262626;
background: -moz-linear-gradient(top, #262626 0%, #5e5e5e 31%, #525252 45%, #050505 100%);
background: -webkit-gradient(left top, left bottom, color-stop(0%, #262626), color-stop(31%, #5e5e5e), color-stop(45%, #525252), color-stop(100%, #050505));
background: -webkit-linear-gradient(top, #262626 0%, #5e5e5e 31%, #525252 45%, #050505 100%);
background: -o-linear-gradient(top, #262626 0%, #5e5e5e 31%, #525252 45%, #050505 100%);
background: -ms-linear-gradient(top, #262626 0%, #5e5e5e 31%, #525252 45%, #050505 100%);
background: linear-gradient(to bottom, #262626 0%, #5e5e5e 31%, #525252 45%, #050505 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr="#262626", endColorstr="#050505", GradientType=0 );
display: none;
margin: 0;
padding: 0 !important;
width: 201px;
position: absolute;
top: 42px;
left: 0;
border: solid 2px #B8B8B8;
border-radius: 29px;
-webkit-border-radius: 29px;
-moz-border-radius: 29px;
-webkit-box-shadow: 2px 2px 3px #949494;
-moz-box-shadow: 2px 2px 3px #949494;
box-shadow: 2px 2px 3px #949494;
}
#menu-bar li:hover > ul {
display: block;
}
#menu-bar ul li {
float: none;
margin: 0;
padding: 0 !important;
}
#menu-bar ul a { /* enlaces submenus*/
padding:10px 1px 10px 15px !important;
color:#242424;
font-size:12px;
font-style:normal;
font-family:georgia;
font-weight: bolder;
text-shadow: 2px 2px 3px #b8b2b8;
}
#menu-bar ul li:first-child > a {
border-top-left-radius: 29px;
-webkit-border-top-left-radius: 29px;
-moz-border-radius-topleft: 29px;
border-top-right-radius: 29px;
-webkit-border-top-right-radius: 29px;
-moz-border-radius-topright: 29px;
}
#menu-bar ul li:last-child > a {
border-bottom-left-radius: 29px;
-webkit-border-bottom-left-radius: 29px;
-moz-border-radius-bottomleft: 29px;
border-bottom-right-radius: 29px;
-webkit-border-bottom-right-radius: 29px;
-moz-border-radius-bottomright: 29px;
}
#menu-bar:after {
content: ".";
display: block;
clear: both;
visibility: hidden;
line-height: 0;
height: 0;
}
<ul id="menu-bar">
<li class="active">POTRUS MAXIMUS</li>
<li>CODEX & DATASLATES</li>
<li>LISTAS
<ul>
<li>1850 Puntos</li>
<li>1500 Puntos</li>
<li>Por raza</li>
</ul>
</li>
<li>BIBLIOTECA
<ul>
<li>Horus Heresy</li>
<li>Warhammer 40K</li>
<li>Warhammer Fantasy</li>
<li>Fantasia Épica</li>
<li>Ciencia Ficción</li>
<li>Otros</li>
</ul>
</li>
<li>REVISTAS
<ul>
<li>White Dwarf Weekly
<ul>
<li>ISSUES 1-42
<li>ISSUES 43-84
</li></li></ul>
</li>
<li>Otras</li>
</ul>
</li>
<li>TUTORIALES</li>
</ul>
i can fix the sub menu design if you want to, but in the general idea, this it what you'r looking for?
#menu-bar ul ul
{
top: 0;
left: 100%;
}
#menu-bar li:hover > ul
{
display: block;
}
live example: http://jsfiddle.net/r9Lxodvb/2/
I've achieved nearly the look that a want and I've removed the irrelevant html and I want to improve the look of the button.
I've created a fiddle for the button.
I think that the color is good (the blue) and the goal is to make the text render and a look that is more clear. How can the text look less blurry and with sharper contrast ? The CSS is
html {
height: 100%;
overflow-y: scroll;
}
body {
background-color: rgb(255, 255, 235);
font-family: Verdana, sans-serif;
font-size: 12px;
line-height: 16px;
color: rgb(0, 0, 0);
height: 100%;
text-align: center;
background-position: initial initial;
background-repeat: initial initial;
}
#post {
display: block;
position: absolute;
top: 16px;
right: 0px;
height: 46px;
line-height: 46px;
}
#post a {
color: rgb(255, 255, 255);
text-shadow: rgb(255, 244, 210) 1px 1px 2px;
font-size: 20px;
}
#post a:hover, #post a span:hover {
text-decoration: none;
}
#ad {
display: inline-block;
border: 1px solid rgb(0, 0, 0);
width: 290px;
height: 45px;
font-size: 150%;
text-decoration: none;
text-align: center;
color: rgb(255, 255, 255);
font-weight: bold;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
border-bottom-left-radius: 5px;
background-image: -webkit-linear-gradient(top, rgb(109, 179, 242) 0%, rgb(84, 163, 238) 50%, rgb(54, 144, 240) 51%, rgb(30, 105, 222) 100%);
background-position: initial initial;
background-repeat: initial initial;
}
#post {
display: inline-block;
border: 1px solid black;
width: 290px;
height: 45px;
font-size: 150%;
text-decoration: none;
text-align: center;
color: white;
font-weight: bold;
-webkit-border-radius: 5px;
border-radius: 5px;
background: #6db3f2; /* Old browsers */
background: -moz-linear-gradient(top, #6db3f2 0%, #54a3ee 50%, #3690f0 51%, #1e69de 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #6db3f2), color-stop(50%, #54a3ee), color-stop(51%, #3690f0), color-stop(100%, #1e69de)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #6db3f2 0%, #54a3ee 50%, #3690f0 51%, #1e69de 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #6db3f2 0%, #54a3ee 50%, #3690f0 51%, #1e69de 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #6db3f2 0%, #54a3ee 50%, #3690f0 51%, #1e69de 100%); /* IE10+ */
background: linear-gradient(to bottom, #6db3f2 0%, #54a3ee 50%, #3690f0 51%, #1e69de 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#6db3f2', endColorstr='#1e69de', GradientType=0); /* IE6-9 */
}
#post {
display: block;
position: absolute;
top: 16px;
right: 0;
height: 46px;
line-height: 46px;
}
#post span {
display: block;
float: left;
height: 52px;
}
#post a {
color: #FFF;
text-shadow: 1px 1px 2px #FFF4D2;
font-size: 20px;
}
#post a:hover, #post a span:hover {
text-decoration: none;
}
#ad {
display: inline-block;
border: 1px solid #000;
width: 290px;
height: 45px;
font-size: 150%;
text-decoration: none;
text-align: center;
color: #FFF;
font-weight: 700;
-webkit-border-radius: 5px;
border-radius: 5px;
background: #6db3f2;
/* Old browsers */
background: 0;
/* FF3.6+ */
background: 0 color-stop(50%, #54a3ee), color-stop(51%, #3690f0), color-stop(100%, #1e69de));
/* Chrome,Safari4+ */
background: 0;
/* Chrome10+,Safari5.1+ */
background: 0;
/* Opera 11.10+ */
background: 0;
/* IE10+ */
background: linear-gradient(tobottom, #6db3f2 0%, #54a3ee 50%, #3690f0 51%, #1e69de 100%);
/* W3C */
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#6db3f2', endColorstr='#1e69de', GradientType=0);
/* IE6-9 */
}
Change the text shadow on #post a (And remove duplicate definitions) e.g.
#post a {
color: #FFF;
text-shadow: 1px 1px 2px #333;
font-size: 20px;
}
Demo: http://jsfiddle.net/4u4T7/5/
The text shadow makes it appear a little off, have a mock about with the text shadow and if you're not sure then use something like a text shadow generator to see a real time preview but I'd recommend using inspect element since it's better in my opinion.
Background
Colorzilla's gradient genetor is very helpful and is browser friendly. though in IE8 and below wont be that High Definition looking.
http://www.colorzilla.com/gradient-editor/
Text
Use text-shadow: 0 2px 0 #f2f2f2;
text-shadow: a, b, c, [d], e;
where a = distance from the text vertically (e.g. 1px, 2px, 0, -1px)
b = distance from the text horizontally (e.g. 1px, 2px, 0, -1px)
c = the weight of how it spreads out / smudge out / blur out (e.g. 1px, 2px, 0, -1px) in your case use 0 because you dont want it blurry looking
d = optional. great use for inner borders
e = color of the shadow
try to read on more of that to understand the syntax
Here is the CSS i'm using:
body {
font-family: 'Open Sans', sans-serif;
background-color: #DB1F1F;
}
.navbar-menu {
background-image: linear-gradient(bottom, rgb(72,174,52) 41%, rgb(101,209,78) 71%);
background-image: -o-linear-gradient(bottom, rgb(72,174,52) 41%, rgb(101,209,78) 71%);
background-image: -moz-linear-gradient(bottom, rgb(72,174,52) 41%, rgb(101,209,78) 71%);
background-image: -webkit-linear-gradient(bottom, rgb(72,174,52) 41%, rgb(101,209,78) 71%);
background-image: -ms-linear-gradient(bottom, rgb(72,174,52) 41%, rgb(101,209,78) 71%);
background-image: -webkit-gradient(
linear,
left bottom,
left top,
color-stop(0.41, rgb(72,174,52)),
color-stop(0.71, rgb(101,209,78))
);
background-repeat: repeat-x;
border-color: #2DB51B;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
border-style: solid;
height: 50px;
width: 100%;
margin: 0px 0px;
position: relative;
}
.navbar-menu ul {
list-style-type: none;
position: absolute;
display: inline;
}
.navbar-menu li {
display: inline;
position: relative;
}
.navbar-menu a {
text-decoration: none;
color: #FFFFFF
}
.navbar-btn {
background-color: #44D1DB;
border-radius: 7px;
border: 1px solid #65A6AB;
height: 20px;
width: 45px;
padding: 10px;
position: relative;
}
.navbar-btn:hover {
background-color: #6CCCF5;
}
Basically i'm trying to make it go more up as it's completely stuck
down. Here is the HTML i'm using:
<!DOCTYPE html>
<html>
<head>
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
<link type="text/css" rel="stylesheet" href="stylesheet.css" />
<title>Button</title>
</head>
<body>
<div class="navbar-menu">
<ul>
<div class="navbar-btn"><li>HTML</li></div>
</ul>
</div>
</body>
</html>
You can use JSFiddle and see how it looks like, I'm not sure how to fix it, I tried putting position: relative; in attempt to fix it.
Top, margin-bottom just make it go up a little, I want it fitting right on the navbar. Can someone help?
Try this:
CSS:
body {
font-family:'Open Sans', sans-serif;
background-color: #DB1F1F;
}
.navbar-menu {
background-image: linear-gradient(bottom, rgb(72, 174, 52) 41%, rgb(101, 209, 78) 71%);
background-image: -o-linear-gradient(bottom, rgb(72, 174, 52) 41%, rgb(101, 209, 78) 71%);
background-image: -moz-linear-gradient(bottom, rgb(72, 174, 52) 41%, rgb(101, 209, 78) 71%);
background-image: -webkit-linear-gradient(bottom, rgb(72, 174, 52) 41%, rgb(101, 209, 78) 71%);
background-image: -ms-linear-gradient(bottom, rgb(72, 174, 52) 41%, rgb(101, 209, 78) 71%);
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0.41, rgb(72, 174, 52)), color-stop(0.71, rgb(101, 209, 78)));
background-repeat: repeat-x;
border-color: #2DB51B;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
border-style: solid;
height: 50px;
width: 100%;
margin: 0px 0px;
position: relative;
}
.navbar-menu ul {
list-style-type: none;
position: relative;
display: inline;
}
.navbar-menu li {
display: inline;
position: relative;
}
.navbar-menu a {
text-decoration: none;
color: #FFFFFF
}
.navbar-btn {
background-color: #44D1DB;
border-radius: 7px;
border: 1px solid #65A6AB;
height: 20px;
width: 45px;
padding: 10px;
display: inline-block;
}
.navbar-btn:hover {
background-color: #6CCCF5;
}
Demo.
Remove this <div class="navbar-btn"><li>HTML</li></div> with this <li class="navbar-btn">HTML</li>