How should I make a button higher without effecting other elements? - html

I have a navigation bar at the top of my website.
HTML:
<text align="center">
<div class="home-nav">
<button class="nav-btn">What's New</button>
<button class="nav-btn">Community</button>
<button class="play-btn">Coming Soon</button>
<button class="nav-btn">Profile</button>
<button class="nav-btn">Information</button>
</text>
CSS:
.home-nav {
width:1240px;
height:49px;
background-color:#F1B84E;
border:5px solid #FFDE84;
border-style:outset;
}
.nav-btn {
width:auto;
height:49px;
background-color:#F1B84E;
border:none;
font-family:showcard gothic;
color:white;
-webkit-text-stroke:1.25px #000000;
-webkit-text-fill-color:#FFFFFF;
font-size:20px;
}
.play-btn {
width:auto;
height:69px;
background-color:#79E119;
-moz-border-radius:10px;
-webkit-border-radius:10px;
border:5px solid #FFFFFF;
font-size:20px;
font-family:showcard gothic;
color:white;
}
I want the play button to be bigger than the normal buttons. But when I make the height higher than the normal buttons and look at it, it makes the normal buttons change position. How can I fix this?

Ok I have bring some small changes to your CSS styling just try these and let me know its working as you wanted or not.
body{
margin:0; padding:0;
}
.home-nav {
width:90%;
margin: 0 auto;
display: block;
background-color:#F1B84E;
border:5px solid #FFDE84;
border-style:outset;
}
.nav-btn {
width:auto;
height:49px;
background-color:#F1B84E;
border:none;
font-family:showcard gothic;
color:white;
-webkit-text-stroke:1.25px #000000;
-webkit-text-fill-color:#FFFFFF;
font-size:20px;
}
.play-btn {
width:auto;
height:70px;
background-color:#79E119;
-moz-border-radius:10px;
-webkit-border-radius:10px;
border:5px solid #FFFFFF;
font-size:20px;
font-family:showcard gothic;
color:white;
}

Related

Float left, vertical align middle, and display table cell does't work

I want image in left side and content in right side. But the image not in the middle when I using float:left, maybe someone of you give me a solution?
HTML:
<div class="wrap-shop"><div class="pro-img">
<img src="http://tshop.r10s.com/c18/f19/b968/3a87/a005/a662/e954/11bee5abd6005056ae13f2.jpg?_ex=125x125"/></div>
<div class="kanan">
<div class="discount">
40%
</div> <!-- end discount -->
<div class="judul">
beauty korea beauty korea beauty korea beauty korea beauty korea
</div>
<div class="harga-coret">Rp<del>1,000,000</del></div>
<div class="harga-asli">Rp 500,000</div>
<div class="bonusRsp">
300,000
</div>
<span class="go-shop">
Rincian Produk
</span>
CSS:
.wrap-pop{
margin-top:10px;
}
.wrap-shop{
border:solid #eaeaea 1px;
width:100%;
height:130px;
}
/* here is problem */
.pro-img{
padding:2px;
border:1px solid red;
--float:left;
vertical-align: middle;
display: table-cell;
width:125px;
height:125px;
background: #fff;
background-size:135px 100px;
--border-right:2px solid #bf0000;
}
.pro-img img{
max-width:125px;
max-height:125px;
border:1px solid yellow;
}
.kanan{
border:3px solid brown;
}
.judul{
font-family:Arial;
font-weight:bold;
margin-left:145px;
text-transform:capitalize;
text-decoration:none;
margin-bottom:1px;
color:black;
font-size:12px;
height:30px;
border:1px solid red;
overflow:hidden;
}
.discount{
border:1px solid yellow;
text-align:center;
font-weight:bold;
font-size:12px;
}
.discount::before {
content: "Diskon ";
}
.bonusRsp{
color:#bf0000;
margin-top:4px;
margin-bottom:5px;
font-size:12px;
}
.bonusRsp::before {
content: "Bonus ";
color:black;
font-size:12px;
}
.bonusRsp::after {
content: " Poin";
color:black;
font-size:12px;
}
.discount a{
color:yellow;
}
.harga-coret{
margin-top:5px;
font-size:11px;
margin-left:150px;
}
.harga-coret a{
color:black;
text-decoration:none;
}
.harga-asli{
font-size:15px;
color:#bf0000;
font-weight:bold;
margin-left:150px;
margin-bottom:2px;
}
.harga-asli a{
color:#bf0000;
text-decoration:none;
}
.go-shop{
border:1px solid #bf0000;
border-radius:2px;
width:120px;
color:#bf0000;
text-align:center;
background-color:white;
margin-left:9px;
text-decoration:none;
font-size:12px;
}
.judul a{
color:black;
text-decoration:none;
}
.go-shop a{
color:black;
text-decoration:none;
}
Here is my code https://jsfiddle.net/dedi_wibisono17/m6snbftt/2/
thank you.
--float:left;, change it to float:left; to work. Update: Add top padding and decrease the height.
Please try following:
.pro-img{
padding-top:15px;
padding-right:2px;
border:1px solid red;
float:left;
vertical-align: middle;
display: table-cell;
width:125px;
height:111px;
background: #fff;
background-size:135px 100px;
--border-right:2px solid #bf0000;
}
HI now used to this code
Define
.kanan{display:table-cell;}
Remove float left .pro-img
Demo
.kanan{display:table-cell;vertical-align:top;}
.wrap-pop{
margin-top:10px;
}
.wrap-shop{
border:solid #eaeaea 1px;
width:100%;
height:130px;
}
/* here is problem */
.pro-img{
padding:2px;
border:1px solid red;
vertical-align: middle;
display: table-cell;
width:125px;
height:125px;
background: #fff;
background-size:135px 100px;
--border-right:2px solid #bf0000;
}
.pro-img img{
max-width:125px;
max-height:125px;
border:1px solid yellow;
}
.kanan{
border:3px solid brown;
}
.judul{
font-family:Arial;
font-weight:bold;
margin-left:145px;
text-transform:capitalize;
text-decoration:none;
margin-bottom:1px;
color:black;
font-size:12px;
height:30px;
border:1px solid red;
overflow:hidden;
}
.discount{
border:1px solid yellow;
text-align:center;
font-weight:bold;
font-size:12px;
}
.discount::before {
content: "Diskon ";
}
.bonusRsp{
color:#bf0000;
margin-top:4px;
margin-bottom:5px;
font-size:12px;
}
.bonusRsp::before {
content: "Bonus ";
color:black;
font-size:12px;
}
.bonusRsp::after {
content: " Poin";
color:black;
font-size:12px;
}
.discount a{
color:yellow;
}
.harga-coret{
margin-top:5px;
font-size:11px;
margin-left:150px;
}
.harga-coret a{
color:black;
text-decoration:none;
}
.harga-asli{
font-size:15px;
color:#bf0000;
font-weight:bold;
margin-left:150px;
margin-bottom:2px;
}
.harga-asli a{
color:#bf0000;
text-decoration:none;
}
.go-shop{
border:1px solid #bf0000;
border-radius:2px;
width:120px;
color:#bf0000;
text-align:center;
background-color:white;
margin-left:9px;
text-decoration:none;
font-size:12px;
}
.judul a{
color:black;
text-decoration:none;
}
.go-shop a{
color:black;
text-decoration:none;
}
<div class="wrap-pop">
<div class="wrap-shop">
<div class="pro-img">
<img src="http://tshop.r10s.com/c18/f19/b968/3a87/a005/a662/e954/11bee5abd6005056ae13f2.jpg?_ex=125x125"/>
</div> <!-- end pro-img -->
<div class="kanan">
<div class="discount">
40%
</div> <!-- end discount -->
<div class="judul">
beauty korea beauty korea beauty korea beauty korea beauty korea
</div>
<div class="harga-coret">Rp<del>1,000,000</del></div>
<div class="harga-asli">Rp 500,000</div>
<div class="bonusRsp">
300,000
</div>
<span class="go-shop">
Rincian Produk
</span>
</div>
</div> <!-- end wrap shop -->
</div> <!-- end wrap-pop -->
Add this display: table; class .wrap-shop
https://jsfiddle.net/m6snbftt/5/

Play Store SearchBar variable width

If you go to Google Play Store Website,you will notice that the width of the SearchBar at the top changes if you change the window width.
Can someone please give me an example on how I can achieve such variable width behaviour using just HTML and CSS?
CSS
body {
margin:0;
min-width:960px;
}
#upperbar {
background-color:#F1F1F1;
white-space:nowrap;
height:60px;
width:100%;
}
#logobardiv {
margin:10px 20px 10px 30px;
display:inline-block;
}
#logo {
height:39px;
width:183px;
}
#searchbardiv {
font-size:0;
display:inline-block;
height:100%;
padding-left:10px;
vertical-align:middle;
white-space:nowrap;
min-width:200px;
}
#searchbar {
height:28px;
/*max-width:589px;*/
max-width:100%;
width:589px;
min-width:545px;
font-size:16px;
border:1px solid #A8A8A8;
border-right:none;
display:inline-block;
vertical-align:middle;
}
#searchbar:hover {
border:1px solid black;
border-right:none;
}
::-webkit-input-placeholder {
color:#A9A9A9;
padding:0 0 0 7px;
}
#searchbutton {
vertical-align:middle;
background:#4584F0;
height:28px;
width:60px;
display:inline-block;
border:1px solid transparent;
border-top-right-radius:2px;
border-bottom-right-radius:2px;
padding:0;
margin:0;
outline:none;
white-space:nowrap;
}
#searchbuttonimg {
vertical-align:middle;
background:url(images/search.png) no-repeat center;
display:inline-block;
height:100%;
width:26px;
}
#signindiv {
display:inline-block;
height:100%;
white-space:nowrap;
vertical-align:middle;
}
#appsimg {
display:inline-block;
vertical-align:middle;
}
HTML
<body>
<div class="container">
<div id="upperbar">
<div id="logobardiv">
<img id="logo" src="https://www.gstatic.com/android/market_images/web/play_logo_x2.png" />
</div>
<div id="searchbardiv">
<input id="searchbar" type="text" placeholder="Search" />
<button id="searchbutton"> <span id="searchbuttonimg"></span>
</button>
</div>
<div id="signindiv">
<img id="appsimg" src="images/apps.png" />
</div>
</div>
</div>
JSFiddle
simple way is you need to set a 3 different width max-width, min-widtht and actual width
like
input{
max-width:100%;
min-width:300px;
width:800px;
}
I used display:flex to achieve the variable length of the elements.
Refer the below link for a good explanation
FlexBox

styling link text in a div

I am having trouble editing links in a div. I would like the link text to be centered vertically inside it's black div. I would also like the box background to change to red on hover...
thanks so much for any assistance!
html:
<div id="footer_subscribe">
<input type="text" class="subscribe" value="Email Address" />
Subscribe
</div>
<div id="footer_facebook">
<img src="http://s26.postimg.org/q5tytjx2t/nav_facebook.jpg" />
Become a Fan
</div>
<div id="footer_youtube">
<img src="http://s26.postimg.org/rywvhvi9h/nav_youtube.jpg" />
Watch Us
</div>
css:
#footer_subscribe {
background:#000;
width:305px;
height:35px;
float:left;
padding:0;
}
input.subscribe {
border:2px solid black;
margin:2px;
width:200px;
height:24px;
}
#footer_facebook {
background:#000;
width:155px;
height:35px;
float:left;
padding:0;
margin-left:5px;
}
#facebook_logo {
width:32px;
height:32px;
}
a.footer_social {
font-family:Arial, Helvetica, sans-serif;
font-size:1em;
/* 14px/16=0.875em */
font-style:normal;
text-decoration:none;
color:#FFF;
}
a:link.footer_social {
font-family:Arial, Helvetica, sans-serif;
font-size:1em;
/* 14px/16=0.875em */
font-style:normal;
text-decoration:none;
color:#FFF;
}
a:link.visited.footer_social {
color:#FFF;
}
a:link.hover.footer_social {
color:#F00;
}
http://jsfiddle.net/4os21tzf/
#footer_subscribe {
background:#000;
width:305px;
height:35px;
float:left;
padding:0;
line-height: 33px;
}
#footer_subscribe:hover {
background:red;
}
#footer_facebook {
background: none repeat scroll 0% 0% #000;
width: 155px;
float: left;
padding: 0px;
margin-left: 5px;
line-height: 35px;
height: 35px;
}
#footer_facebook:hover {
background:red;
}
a.footer_social:link {
font-family: Arial,Helvetica,sans-serif;
font-size: 1em;
font-style: normal;
text-decoration: none;
color: #FFF;
vertical-align: top;
padding-top: 10px;
}
a.footer_social:hover{
color: red;
}
JSFIDDLE DEMO
To change the colour of the link on hover?
a.footer_social:hover{
color:#F00;
}
To change the colour background on hover (link):
a.footer_social:hover{
color:#000000;
background-color:red;
}
Change the colour of the background (entire div)
#footer_facebook:hover{
background-color:red;
}
#footer_subscribe:hover
{
background:Red;
}
To change color add this to your CSS:
#footer_subscribe:hover
{
background-color:red;
}
#footer_facebook:hover
{
background-color:red;
}
For text alignment:
a:link.footer_social {
font-family:Arial, Helvetica, sans-serif;
font-size:1em;
/* 14px/16=0.875em */
font-style:normal;
text-decoration:none;
color:#FFF;
vertical-align: top;
}
use display:table; in parent div and use display: table-cell; vertical-align: middle; in link
#footer_subscribe {
display:table;
}
a.footer_social:link{
display: table-cell;
vertical-align: middle;
}
#footer_subscribe:hover{
background-color:red;
}
working jsFiddle Link
hope this works for you.

CSS Styling fort Fluid Width

My site here is fluid width, but the middle header section with the search bar and image doesn't resize correctly in either IE, Chrome or FF.
I've tried using media screen stylesheets for lower screen resolutions, but this just causes there to be a gap to the right of the right-hand image in some browsers where they display the width differently.
If anyone could possibly take a look and see it at different resolutions and browsers that would be great, and perhaps help with any suggestions.
Currently in IE9, when it's reduced slightly under 1263px (approx 1250px), the image jumps down entirely and looks awful.
Here's the CSS:
/*Town Image */
#town-image-search {
box-shadow:0 5px 5px #CCC;
background:0;
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fafafa',endColorstr='#e4e4e4');
border-top:1px solid #D6D2D5;
border-bottom:#d1d1d1;
}
#search-bar {
float:left;
width:16.5%;
padding:8px 15px;
}
input#search {
width:100%;
height:22px;
color:#aaa;
text-indent:10px;
border:1px solid #d6d6d6;
font-size:14px;
-webkit-border-bottom-left-radius:5px;
-webkit-border-radius:5px;
-moz-border-radius:5px;
border-radius:5px;
margin:0 0 6px;
padding:0;
}
input#submit {
width:100%;
border:1px solid #666;
height:22px;
color:#fff;
text-shadow:0 1px 0 #555;
background-color:#803C6D;
font-family:'Arial Rounded MT Bold';
cursor:pointer;
-webkit-border-top-right-radius:5px;
-webkit-border-radius:5px;
-moz-border-radius:5px;
border-radius:5px;
padding:0;
}
#middle-top {
height:68px;
float:left;
width:81%;
border-left:1px solid #Fafafa;
}
#town-name {
word-spacing:5px;
position:relative;
z-index:0;
float:left;
font-family:'arial rounded mt bold';
font-size:36px;
color:#354057;
line-height:69px;
text-indent:27px;
letter-spacing:-3px;
}
#town-name span {
font-family:'arial rounded mt bold';
color:#354057;
}
img#heart {
float:right;
width:230px;
height:68px;
position:relative;
z-index:10;
margin-right:-120px;
}
img#town-image {
width:404px;
height:68px;
float:right;
}
Any ideas would be much appreciated.
#middle-top a float:right and changed the width to 80%

link style scheme not working

a.mO {color: white; cursor:pointer; margin-left:10px; font-weight:400; font-size:12px; display:block; border-top:1px solid #300;}
a.mO:link {
color: white; cursor:pointer; margin-left:10px; font-weight:400; font-size:12px; display:block; border-top:1px solid #300;
}
a.mO:visited {
color: white; cursor:pointer; margin-left:10px; font-weight:600; font-size:16px; display:block; border-top:1px solid #300;
}
a.mO:hover {
color: white; cursor:pointer; margin-left:10px; font-weight:900; font-size:12px; display:block; border-top:1px solid #300;
}
a.mO:active{
color: white; cursor:pointer; margin-left:10px; font-weight:900; font-size:14px; display:block; border-top:2px solid #300;
}
The first code works. But as soon as I replace it with the second one it stops working.
My html is :
<div><a class="mO" onclick="loadPage(31);">ABCD Status</a></div>
Thanks for help...
Some of these will not work unless you include the href attribute (it isn't a link other wise):
<a class="mO" href="#" onclick="loadPage(31);">ABCD Status</a>
You may also want to return false; after calling the function, to prevent the page from jumping to to top. You can either do onclick="loadPage(31); return false;", or onclick="return loadPage(31);", and have it returning false.
Try changing your code to
<div><a class="mO" href="#" onclick="loadPage(31);">ABCD Status</a></div>
and see if that helps any.