how to modify the button styling and size - css

I have the css and html code for a button as given below. the button will be in header..
<div data-role="header" data-position="fixed">
<a href="#home" data-role="button" data-inline="false" data-icon="my-map" data-theme="c" data-iconshadow="false">
<img src='http://img3.wikia.nocookie.net/__cb20131126195004/epicrapbattlesofhistory/images/a/aa/Home_icon_grey.png' alt="custom buttom" />
</a>
css code:
.ui-icon-my-map {
background-position: 4px 50%;
background-size: 16px 11px;
height: 12px;
margin-top: -8px !important;
width: 15px;
background-color: transparent;
}
The button should appear like image instead of button.and how to reduce the size of button to normal home icon size.

Change the code to this....
<div data-role="header" data-position="fixed">
<a href="#home" data-role="button" data-inline="false" data-icon="my-map" data-theme="c" data-iconshadow="false">
<img src='http://img3.wikia.nocookie.net/__cb20131126195004/epicrapbattlesofhistory/images/a/aa/Home_icon_grey.png' alt="custom buttom" style="height:32px;border:none;" />
</a>
Please comment back if you need/require further help

<div data-role="header" data-position="fixed"> <a href="#home" data-role="button" data-inline="false" data-icon="my-map" data-theme="c" data-iconshadow="false" class="home"><img src='http://img3.wikia.nocookie.net/__cb20131126195004/epicrapbattlesofhistory/images/a/aa/Home_icon_grey.png' alt="custom buttom" />
.home img {
height:35px;
display:block;}
http://jsfiddle.net/Vgcuj/

Related

change resizer's properties thorguht css

i have a div which is resizeable through css.
HTML :
<div id="resize">
<img src="{{env.assets_url}}assets/images/minified_signhere.png" [hidden]="!isNameNull(sign.name)" [attr.id]="'sign-img' + myindex">
<img src="{{env.assets_url}}assets/images/minified_signhere_dim.png" [attr.id]="'dimimg' + myindex" [hidden]="isNameNull(sign.name)">
<div style="position: absolute;z-index: 1000;left: 100%;" class="signbtns">
<span style="font-size: 17px; margin-bottom: 5px" class="fa fa-trash float-right change-cursor" aria-hidden="true" (click)="deleteSign(myindex)"
data-toggle="tooltip" title="Click to delete the signature."></span>
<span style="font-size: 17px;" class="fa fa-pencil float-right change-cursor" (click)="editSign(myindex)" aria-hidden="true"
data-toggle="tooltip" title="Click to edit the signature."></span>
</div>
</div>
and following is CSS
#resize {
display: flex;
resize: both;
overflow:auto;
}
::-webkit-resizer {
background-color: red;
cursor: ew-resize;
}
div is being resize correctly. i want to customize the background color of resizer but the ::-webkit-resizer doesn't seem to work.
You change the color of #resize, not ::-webkit-resizer.

margin being included in link - need to exclude margin from linked area

I have this JSFiddle: https://jsfiddle.net/96urhqcz/
There are 4 divs in a row - the HTML looks like this:
<div class="g-1-4 app">
<a style="text-decoration:none;" href="https://link1/">
<div style="margin:10px; padding: 30px 0px; background:#E74C3C" class="app">
<i class="fa fa-3x fa-comments-o" width="50%" style="display:block; margin:auto" src="/static/launcher/comments-o"></i>
Link Number 1
</div>
</a>
</div>
<div class="g-1-4 app">
<a style="text-decoration:none;" href="https://link2/">
<div style="margin:10px; padding: 30px 0px; background:#9D55B8" class="app">
<i class="fa fa-3x fa-paper-plane" width="50%" style="display:block; margin:auto" src="/static/launcher/paper-plane"></i>
Link Number 2
</div>
</a>
</div>
<div class="g-1-4 app">
<a style="text-decoration:none;" href="https://link3/">
<div style="margin:10px; padding: 30px 0px; background:#3395DD" class="app">
<i class="fa fa-3x fa-street-view" width="50%" style="display:block; margin:auto" src="/static/launcher/street-view"></i>
Link 3
</div>
</a>
</div>
<div class="g-1-4 app">
<a style="text-decoration:none;" href="https://link4/">
<div style="margin:10px; padding: 30px 0px; background:#00838F" class="app">
<i class="fa fa-3x fa-line-chart" width="50%" style="display:block; margin:auto" src="/static/launcher/line-chart"></i>
Link 4
</div>
</a>
</div>
The CSS for g-1-4 looks like this:
.g-1-4{
width: 25%;
}
As you can see in the JSFiddle - the margins between the boxes are 'linked' to the appropriate box.
Ultimately I'm trying to have a 4-across layout, but have the margins not linked. When a user mouses between the boxes I want it to be a regular mouse with no clickability.
I'm sure it's something really simple I'm missing - but I can't seem to correct it.
Any thoughts or ideas?
You can set a fixed width to your divs, and using flexbox they will be automaticaly displayed with space which is not 'linked'.
Hope this little code will help you.
.flex {
display : flex;
justify-content : space-around;
}
.div1, .div3 {
width : 120px;
height : 120px;
background-color : red;
}
.div2, .div4 {
width : 120px;
height : 120px;
background-color : blue;
}
p {
margin : 0;
color : white;
line-height: 120px;
font-size : 12px;
text-align : center;
}
<div class="flex">
<a href="#" class="div1">
<p>LINK 1</p>
</a>
<a href="#" class="div2">
<p>LINK 2</p>
</a>
<a href="#" class="div3">
<p>LINK 3</p>
</a>
<a href="#" class="div4">
<p>LINK 4</p>
</a>
</div>
Take the margin off of the <div> and add it to the <a> that's wrapping the div. Also add style="display:block:" to the <a>.
This CodePen has the updates.
The issue is coming from your using the table cell display method.
.g > div,
.g-m > div {
display: table-cell;
vertical-align: top;
}
I also support the flex box usage as pointed out by Louis.
What is happening is that the link element is expanding to the 100% of the container div to get some space you could set a specific width for the a tag or you could add some padding to the container element, you will have to play with padding and width to make it look good though.
https://jsfiddle.net/96urhqcz/1/
.g-1-4{
width: 25%;
padding: 10px;
}

How can I get an icon verically centered inside a button with Semantic UI

I've add a button inside a a content div which is inside a item div. I want to add a nice "read more" button with an icon inside it. This is the code I've used.
<div class="content">
<div class="extra">
<a class="ui basic teal button" href="blogs/<%=blogs[i]._id%>">
Read more
<i class="chevron right icon"></i>
</a>
</div>
</div>
Which results in a button where the icon is not centered vertically as shown below.
I wasn't able to solve the problem from the other answers but it made me realize that it's the difference in font-size that makes the icon decentered.
using
i.icon {
font-size: inherit;
}
I finally got this result:
Try below way, hope it will be useful to you
a{
border:1px solid blue;
text-decoration:none;
padding:10px;
display:inline-block;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" />
<div class="content">
<div class="extra">
<a class="ui basic teal button" href="blogs/<%=blogs[i]._id%>">
Read more
<i class="fa fa-arrow-right"></i>
</a>
</div>
</div>
Try this:
a.basic.button{
border:1px solid #66fcf1;
color: #66fcf1;
border-radius: 5px;
text-decoration: none;
padding: 10px;
display: inline-block;
vertical-align: middle;
transition: all 0.3s ease;
}
a.basic.button i{
vertical-align: middle;
}
a.basic.button:hover{
background:#66fcf1;
color: #fff;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" />
<div class="content">
<div class="extra">
<a class="ui basic teal button" href="blogs/<%=blogs[i]._id%>">
Read more
<i class="fa fa-chevron-right"></i>
</a>
</div>
</div>
Use "basic button" class
<link rel="stylesheet" href="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.css">
<button class="ui basic button">
Read more
<i class="icon angle right"></i>
</button>

bootstrap link area smaller on focus and active?

I have a thumbnail gallery and each of the <a> elements have an outline around them, when I click on one of the links, the outline is noticeably shorter (only by a pixel or two but enough to be annoying) than the surrounding elements
link to codepen - http://codepen.io/Davez01d/pen/NxMzYy?editors=1100
here's the html -
<div class="row vert-space-30"><!--row-->
<div id="padding-helper"><!--padding-helper-->
<div class="col-sm-3 col-xs-6 port-tile text-center">
<a class="thumbnail" href="http://codepen.io/Davez01d/full/obyBbz/" target="_blank">
<img src="http://i1155.photobucket.com/albums/p558/Davez01d/Portfolio%20site-Codepen/f043ed05-0df8-42b9-a7b3-57ad6cab5f3b_zpsq2074gko.png" alt="Pomodoro thumbnail"/>
<div class="caption">
<h4>Pomodoro Timer</h4>
<p class="tech-used">JavaScript, jQuery, HTML, Css</p>
</div>
</a>
</div>
<div class="col-sm-3 col-xs-6 port-tile text-center">
<a class="thumbnail" href="http://codepen.io/Davez01d/full/JGvdxX/" target="_blank">
<img src="http://i1155.photobucket.com/albums/p558/Davez01d/Portfolio%20site-Codepen/726c239e-157c-4e4d-8931-77f3a4c9de9c_zpslofzlecy.png" alt="Calculator thumbnail"/>
<div class="caption">
<h4>JavaScript Calculator</h4>
<p class="tech-used">JavaScript, jQuery, HTML, Css</p>
</div>
</a>
</div>
<div class="col-sm-3 col-xs-6 port-tile text-center">
<a class="thumbnail" href="http://codepen.io/Davez01d/full/gPegpd/" target="_blank">
<img src="http://i1155.photobucket.com/albums/p558/Davez01d/Portfolio%20site-Codepen/e9b19619-ed3c-4149-ab15-0a039c59f5a7_zps7vmaslo8.png" alt="Quote generator thumbnail"/>
<div class="caption">
<h4>Random Quote Generator</h4>
<p class="tech-used">jQuery, twitter API</p>
</div>
</a>
</div>
<div class="col-sm-3 col-xs-6 port-tile text-center">
<a class="thumbnail" href="http://codepen.io/Davez01d/full/KVQzwr/" target="_blank">
<img src="http://i1155.photobucket.com/albums/p558/Davez01d/Portfolio%20site-Codepen/cc4d40ed-a085-43d6-9dde-90c59161b023_zps0ppintnt.png" alt="Web sketchpad thumbnail"/>
<div class="caption">
<h4>Web Sketchpad</h4>
<p class="tech-used">jQuery, HTML, CSS</p>
</div>
</a>
</div>
</div><!--padding-helper-->
</div><!--row-->
and the css-
.port-tile a {
z-index: 0;
position: relative;
border-radius: 0;
border: none;
padding: 0;
outline: 3px solid #d63c20;
transition: all .12s ease;
}
.port-tile a:hover {
z-index: 10;
outline: 3px solid #d63c20;
transform: scale(1.12, 1.12);
}
.port-tile a:active, a:focus {
outline: 3px solid #d63c20;
}
Also side-note, I'm finding it hard to find a list of all the bootstrap effects on links, buttons, etc, is there a good resource for this? it would help me out a lot.
It's the a:focus { outline-offset: -2px; } that I believe you're referring to, which causes this:
You could override that with your own style, just set
a:focus {
outline-offset: 0;
}
if you don't have a need for this rule at all. Or, target the specific elements where you wish to remove it.

Hover image on top of another image

I'm trying to add some hover effect on some images I got.
<div id="horizontal_list">
<div class="grid_3 first overlay">
<a href="#">
<img border="0" alt="first" src="path">
</a>
</div>
<div class="grid_3 overlay">
<a href="#">
<img border="0" alt="first" src="path">
</a>
</div>
</div>
When I hover the div with the overlay class I want another image to hover on top of the imagetag..
I've got the following css:
#horizontal_list{
margin-top: 18px;
height: 330px;
}
.grid_3{
display: inline;
float: left;
margin-left: 10px;
margin-right: 10px;
}
.first{
margin-left: 0px !important;
}
.last{
margin-right: 0px !important;
}
.overlay{
height: 330px;
}
.overlay:hover{
background: url('path') no-repeat;
}
I'm not sure what you mean by 'imagetag' but here is what I think you mean:
What you can do, is adding the second image in your html:
<div id="horizontal_list">
<div class="grid_3 first overlay">
<a href="#">
<img class="first_img" border="0" alt="first" src="path">
<img class="sec_img" border="0" alt="second" src="path">
</a>
</div>
<div class="grid_3 overlay">
<a href="#">
<img class="first_img" border="0" alt="first" src="path">
<img class="sec_img" border="0" alt="second" src="path">
</a>
</div>
</div>
And in your CSS:
.overlay {position: relative;}
.overlay:hover a img.sec_img {display: none;}
.overlay:hover a img.sec_img {
display: block;
position: absolute;
background: url(path) no-repeat;
top: 0;
left: 0;
width: [imgwidth]px;
height: [imgheight]px;
}
Be sure to change [imgwidth] and [imgheight] into the correct dimensions.
HTML
<div class="hoverholder">
<a href="#" class="picone">
<img src="#" alt="" />
</a>
<a href="#" class="pictwo">
<img src="#" alt="" />
</a>
</div>
CSS
.pictwo {display:none;}
.hoverholder:hover .picone{
display:none;
}
.hoverholder:hover .pictwo{
display:block;
}

Resources