I have a weird issue with the text under the icon bar not being centered under the icons.
code example
<div class="row">
<div class="small-12 columns">
<div class="icon-bar five-up small">
<a class="item" a href="/index.html">
<i class="fi-home"></i>
<div>
<label>Home</label>
</div>
</a>
<a class="item" a href="/cart.html">
<i class="fi-shopping-cart"></i>
<div>
<label>Cart</label>
</div>
</a>
<a class="item" a href="/pages/about-us">
<i class="fi-info"></i>
<div>
<label>About</label>
</div>
</a>
<a class="item" a href="/pages/contact-us">
<i class="fi-mail"></i>
<div>
<label>Contact</label>
</div>
</a>
<a class="item" a href="/account/login">
<i class="fi-torso"></i>
<div>
<label>Account</label>
</div>
</a>
</div>
</div>
</div>
I've tried to center the labels with no luck. Has anyone had any issue with this before. Can't post a screenshot since it's a new account. but the contact label and account label seem to start on the left of the icon and go right instead of the start of the actual icon box.
Ok your problems is about CSS in foundation. the property "padding" here:
.icon-bar > * {
font-size: 1rem;
padding: 1.25rem;
}
To fix that, you need to add a media query for mobile. Maybe something like:
#media (max-width: 400px) {
a.item {
padding-left: 0;
padding-right: 0;
position: relative;
text-align: center;
}
}
Change the value 400px of your resolution. If its doesn't work because CSS style is overrite by another.. change padding-left and padding-right for:
padding-left: 0 !important;
padding-right: 0 !important;
Check this JSFiddle
Related
So I have footer section on the website I'm currently building, and the problem is order of them showing. I want to social icons be above ©
Have a look: footer
html:
<div id="footerbot">
<div class="container">
<div class="row">
<div class="col-md-6">
<h5 class="fbh">©2018 - Appo, All Right Reserved</h5>
</div>
<div class="col-md-6">
<img src="img/facebook.png" href="#">
<img src="img/twitter.png" href="#">
<img src="img/dribble.png" href="#">
<img src="img/gplus.png" href="#">
<img src="img/youtube.png" href="#">
</div>
</div> <!-- end of row -->
</div>
css:
#footerbot {
background-color: rgba(34, 48, 71, 0.8);
}
#footerbot img {
display: block;
float: right;
top: 50%;
padding-top: 35px;
padding-left: 15px;
}
#footerbot h5 {
color: #00FFF0;
line-height: 100px;
}
I tried to add class 'order-md-6' to each div with col-md-6, but first of all it didn't work, and secondly it broke layout - it 'pushed' both elements to center. Is it even possible in bootstrap4? I also have a problem centering these items u can see on image I've upload. I'm struggling with this for 2hours and I have no idea how to get this done. I would appreciate any help. Thanks
Bootstrap 4 uses flexbox to position the columns in their rows so you can add the following to your CSS to the control the order of the columns:
.col-md-6:last-child {
order: -1;
}
Not sure if what you provided is the full code sample of your footer or not, but if that's your full html, you're missing a closing tag.
Also, assuming all you want are the icons to go above the copyright line and centered, try this:
#footerbot .socialIcons {
text-align: center;
}
<div id="footerbot">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="socialIcons">
<img src="img/facebook.png" href="#">
<img src="img/twitter.png" href="#">
<img src="img/dribble.png" href="#">
<img src="img/gplus.png" href="#">
<img src="img/youtube.png" href="#">
</div>
<h5 class="fbh">©2018 - Appo, All Right Reserved</h5>
</div>
</div> <!-- end of row -->
</div>
</div>
I have a template of handlebars in which there are multiple div which i need to make clickable.
However, in my div the text is dynamic, how will i be able to make whole div clickable. Here is the code
<div class="row">
{{#each event}} {{#is this.event ../eventName }}
<div class="col s12 m3 13 al">
<div class="card ">
<div class="card-image">
<img src="/Small/{{this.imageId}}.JPG">
<span class="imageClick"></span>
</div>
<div class="card-action sp1">
<div class="action-time">
<a href="/{{this.imageId}}/love" class="like sp">
<i class="material-icons fav">favorite</i>
</a>
<span id="{{this.imageId}}" class="like-text">{{this.love}}</span>
</div>
<div class="action-time">
<a href="/{{this.imageId}}/laugh" class="haha sp">
<i class="material-icons laugh">sentiment_very_satisfied</i>
</a>
<span id="{{this.imageId}}laugh" class="haha-text">{{this.laugh}}</span>
</div>
<div class="action-time">
<a href="/{{this.imageId}}/sad" class="downvote sp">
<i class="material-icons down">trending_down</i>
</a>
<span id="{{this.imageId}}sad" class="downvote-text">{{this.sad}}</span>
</div>
{{!-- {{this.imageId}} --}}
</div>
<div class="card-action">
<a class="waves-effect waves-light btn share">button</a>
</div>
</div>
</div>
{{/is}} {{/each}}
I want to make my div action-time clickable with the link in the a tag. I tried to use the popular <span> solution like this but no use. It works for the last action-time making first two not working. How can i solve this.
Css code for action-time and card is:
.action-time{
display: inline-block;
border: 1px solid rgba(202, 202, 202, 0.733);
width: 32%;
padding-top:2px;
padding-left: 4px;
border-radius:8px;
}
and for card :
.card {
margin: 10px;
padding: 5px;
border-radius: 8px;
box-shadow: 0 19px 38px rgba(0,0,0,0.30), 0 15px 12px rgba(0,0,0,0.22);
}
.card-action {
padding: 5px 0px !important;
/* padding-right: 5px !important; */
}
Here is what my webpage looks like, I have multiple of those cards
I want to make the whole area in border of heart clickable, rather than just the image to heart.
You can update your html so that the <span> is inside your <a>.
<a href="/{{this.imageId}}/laugh" class="haha sp">
<i class="material-icons laugh">sentiment_very_satisfied</i>
<span id="{{this.imageId}}laugh" class="haha-text">{{this.laugh}}</span>
</a>
Displaying your <a> as a block element will have it fill up the entire <div>. Then you can float your <span> to the right and style it accordingly until it's where you want it exactly.
.action-time a {
display: block;
}
.action-time span {
float: right;
}
You can write some javascript to handle the operation
$(" .action-time").click(function() {
window.location = $(this).find("a").attr("href");
return false;
});
Looks for a link inside div with class of "action-time". Redirects to that links value when anywhere in div is clicked.
I am making a website using semantic ui as my framework and everything looks fine except when I click on the sidebar icon for the sidebar menu to pop up, the background image disappears that I've set using
$body {
background:url('https://lostandtaken.com/wpcontent/uploads/2010/04/141-1560x1170.jpg');
}
and that worked fine. But it disappears as soon as the sidebar menu pops up. I tried looking at the relationship between the sidebar and the body tag but I realized that the body height was way smaller than the size of the screen meaning that 80% of the elements were overflowing. I tried setting the body height to be 100% but that didn't work and also for some reason, chrome sets overflow to visible even if I manually set it to be hidden just to see and it also creates a pushable class. I am included a screenshot to show the height of the body according to the browser: which like 15 or 20% of the full height.
and Here is the sidebar
Here are the important part of my code
HERE IS A JSFIDDLE IF YOU WOULD LIKE TO SEE THE CODE: https://jsfiddle.net/bmb45L3p/
HTML code
<!--=================================================================================================== -->
<body>
<div class="ui borderless inverted fixed menu trial " style=" z-index: 10; font-family: 'IM Fell Double Pica', serif; font-size: 16px;">
<a class="item icon "> <i class=" wide sidebar big icon" id="mysidebar"></i></a>
<a class=" item" style="font-family: 'IM Fell Double Pica', serif; font-size: 20px; font-weight: bold;"> MENU </a>
<div class= " right menu">
<a class="item" id="logospot"></a>
</div>
</div>
<div class ="ui sidebar compact inverted labeled icon vertical menu" id="theirsidebar" style="z-index: 99;">
<a class ="active item">
<i class="home icon"></i>Home</a>
<a class ="item">
<i class="info icon"></i>About SLIDE</a>
<a class ="item">
<i class="user circle outline icon"></i>Meet the Staff</a>
<a class ="item">
<i class="users icon"></i>Meet SLIDERS</a>
<a class ="item">
<i class="block layout icon"></i>Committees</a>
<a class ="item">
<i class="announcement icon"></i>Events</a>
<a class ="item">
<i class="image icon" ></i>Pictures</a>
<a class ="item">
<i class="write icon"></i>Apply</a>
<a class ="item">
<i class="mail outline icon" ></i>Contact us</a>
<a class = "item">
<i class="user icon"></i>Member Login
</a>
<a class = "item">
<i class="user circle icon"></i>Staff Login
</a>
</div>
<div class="ui pusher">
<!--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<div class="ui container" style="display: block ; padding-top: 120px;">
<h3 style= "font-family: 'IM Fell Double Pica', serif; font-size: 60px;" class = "ui header center aligned">MEET OUR '17-'18 STAFF</h3>
css
Try this
Remove the image CSS from body and add an Id called as bg_img
<body>
<div id="bg_img">
<!--menu code here-->
<!--main content-->
<!--footer-->
</div>
</body>
add the css to id
html,body{margin:0;padding:0;height:100%;}
#bg_img{
background:url('http://www.theriversouth.org/wp-content/uploads/2016/01/Light-Grey-Background-Tumblr-8.jpg');
background-repeat: no-repeat;
background-size: cover;
width: 100%;
height: auto;
background-position: center;
min-height:100%;
}
I have a Div element that pops up when clicking on a icon.
This works fine on desktop. But when I'm trying it on mobile it appears underneath the content instead of above, although the elements z-index is set to 5000.
It seems like it only ends up underneath when running on a webkit-based browser. First I thought it was depending on the height of the page but it's only when i'm running chrome in device toolbar and all phones that I've tested.
It should look like this. It's a popup that appears when you click the Info button in the footer:
The css for the box/popup is element with class cms-footer-info is the popup/box:
position: fixed;
background-color: #444445;
color: #fff;
height: auto;
display: block;
left: 1%;
bottom: 60px;
padding: 2%;
z-index: 4000;
Html for the the footer :
<div class="footer">
<div class="footer-column-one">
<i class="fa fa-globe fa-3x" aria-hidden="true"></i>
<div class="cms-links">
<h6>Document identity</h6>
<div>
<span class="cms-footer-info-0-label">something</span>
<span class="cms-footer-info-0-value">else</span>
</div>
</div>
</div>
<div class="cms-footer-center">
<div class="cms-footer-center-0">Some Text </div>
</div>
<div class="footer-column-three">
<i class="fa fa-info-circle fa-3x" aria-hidden="true"></i>
<div class="cms-footer-info">
<h6>Document identity</h6>
<div class="cms-footer-info-0">
<span class="cms-footer-info-0-label">Publ. no. </span>
<span class="cms-footer-info-0-value">T810181</span>
</div>
<div class="cms-footer-info-1">
<span class="cms-footer-info-1-label">Label</span>
<span class="cms-footer-info-1-value">Value </span>
</div>
</div>
</div>
</div>
The content underneath the pop up has static layout and has no z-index:
The css:
margin-bottom: 65px;
margin-left: auto;
margin-right: auto;
max-width: 700px;
display: block;
The html:
<div class="container">
<div>
Alot of text. Wrapped in spans, divs and so on.
</div>
</div>
Any tips are greatly appreciated. Thank you!
Link to working example: Working example
When you have loaded the site. Try pressing the info or globe icon in the bottom. It will show you the relevant popups, now open the developer console and choose toggle device toolbar top left corner in the developer console in Chrome or visit the url on a phone.
take out the overflow:hidden; from the footer. it solved it for me.
I'm trying to make this navigation bar to work without that "jumpy" effect on Safari.
It works ok on all other browsers.
The problem is that hovering on the links make the bar jumps down.
You can check the code here
http://jsfiddle.net/kpady8hr/14/
<nav class="top-menu">
<div class="divider first"></div>
<a href="#" class="product">
<span class="hover">Link1</span>
<span class="link">Link1</span>
</a>
<div class="divider"></div>
<a href="#" class="product">
<span class="hover">Link2</span>
<span class="link">Link2</span>
</a>
<div class="divider"></div>
<a href="#" class="product">
<span class="hover">Link3</span>
<span class="link">Link3</span>
</a>
<div class="divider last"></div>
</nav>
Any suggestions?
Thanks in advance :)
You need to style the links with vertical-align and compensate in the divider.
For example:
.top-menu .divider.first {
background-position: left center; /* change this */
}
.top-menu .product {
display: inline-block;
position: relative;
height: 22px;
overflow: hidden;
cursor: pointer;
font-size: 18px;
font-weight: 500;
vertical-align: bottom; /* add this */
}