Scaling an SVG <img> to fit viewport - html

Here's the WIP :
www.wearethefirehouse.com/wcftest
Logo is .SVG from Illustrator.
My code is (included the whole section for perspective, maybe conflicting div's?):
<!-- Intro Header -->
<header class="intro">
<div class="intro-body">
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<img src="img/master-logo-white.svg" alt="Wine Country Flooring Logo">
<a href="#about" class="btn btn-circle page-scroll">
<i class="fa fa-angle-double-down animated"></i>
</a>
</div>
</div>
</div>
</div>
</header>
If you shrink browser window you'll see that it STARTS fine, then jumps around a bit, finally settling at a uselessly large iteration by the time you're in a mobile viewport.
How do I get it to scale cleanly?
This is my first time with SVG and I know it's something I need to use more... trial by fire, right?
Any help would be appreciated!

This has nothing to do with SVG. It's jumping around because of Bootstrap and the way it is resizing elements on the page based on page width.
If you don't want it to jump so much, you could use different bootstrap styles. Eg.:
<div class="col-md-12>
<img src="img/master-logo-white.svg" alt="Wine Country Flooring Logo">
<a href="#about" class="btn btn-circle page-scroll">
<i class="fa fa-angle-double-down animated"></i>
</a>
</div>

Related

Cannot align fontawesome icons on sidebar

I'm having some real trouble trying to align icons within their divs. Nothing I try works whether it be creating custom CSS or trying to use bootstrap's text-align-center.
Here's a cut down example of the navbar:
<div id="appSidenav" class="sidenav">
<button class="closebtn btn" id="navClose" onclick="closeNav()"><i class="fas fa-chevron-left"></i></button>
<button class="openbtn btn" id="navOpen" onclick="openNav()"><i class="fas fa-bars"></i></button>
<a href="#" class="pt-3">
<div class="row">
<div class="col-2">
<i class="fas fa-home"></i>
</div>
<div class="col">
<span>Home</span>
</div>
</div>
</a>
<a href="#">
<div class="row">
<div class="col-2">
<i class="fas fa-users"></i>
</div>
<div class="col">
<span>Contacts</span>
</div>
</div>
</a>
</div>
I've tried to add text-center to the cols, I've also tried adding text-align: center; to the CSS but nothing seems to make any difference. I've also tried different sized cols and cols with no padding or margin.
I've tried adding an alignment to pretty much every tag or class and nothing works.
Any ideas?
Thanks!
UPDATE
Nobody seems to quite understand what I'm getting at, so I'll post a picture.
I've tried to align the icons using both CSS and bootstrap classes. I can live with it I guess but it's a bit annoying. Here's what's happening:
I don't understand what you mean exactly,
<!DOCTYPE html>
<html>
<head>
<title>Font Awesome 5 Icons</title>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<script src='https://kit.fontawesome.com/a076d05399.js'></script>
<!--Get your own code at fontawesome.com-->
</head>
<body>
<div id="appSidenav" class="sidenav">
<button class="closebtn btn" id="navClose" onclick="closeNav()"><i class="fas fa-chevron-left"></i></button>
<button class="openbtn btn" id="navOpen" onclick="openNav()"><i class="fas fa-bars"></i></button>
<a href="#" class="pt-3">
<div class="row">
<div class="col-2">
<i class="fas fa-home"></i> <span>Home</span>
</div>
</div>
</a>
<a href="#">
<div class="row">
<div class="col-2">
<i class="fas fa-users"></i> <span>Contacts</span>
</div>
</div>
</a>
</div>
</body>
</html>
If you want to center align them, you can:
try text-align: center on the parent/wrapper of the item you are trying to center align
another method is to add display: flex to the parent/wrapper and margin: auto to the item you are trying to center align.
i assume that you want to center align a link... If so i think u are supposed to add "a" after the div class in css... I will take home for exmaple.
I think the css should look something like,
.col a{ text-align:cenetr; }
Hopefully it helps.. thx

Pure CSS accordion stop anchor page scroll

I have a pure CSS accordion, it works great, but an issue is handling click shifting the screen up to the anchor tag;
<div class="collapse-content">
<div class="collapse" id="instagram">
<a class="instagram" href="#instagram" onClick="return false;"><i class="fab fa-instagram"></i>Insta</a>
<div class="content">
<div class="inner-content">
Insta content
</div>
</div>
</div>
<div class="collapse" id="twitter">
<a class="twitter" href="#twitter"><i class="fab fa-twitter"></i>Twitter</a>
<div class="content">
<div class="inner-content">
Twitter content
</div>
</div>
</div>
<div class="collapse" id="dribbble">
<a class="dribbble" href="#dribbble"><i class="fab fa-dribbble"></i>Dribble</a>
<div class="content">
<div class="inner-content">
Dribble content
</div>
</div>
</div>
</div>
How can I suppress the browser scrolling the anchor to the top of the screen? I've tried adding a ? ! and 0 to the end of the anchor, but that breaks the link from working and as you can see above I've tried onClick="return false;" which stops the click. I'm guessing what I need is some sort of offset, as I don't want to suppress the click event just the scrolling too.
# the moment I'm avoiding using Jquery, ideally no JS but trying to keep it as simple as possible.
If these aren't links, then you shouldn't be using <a> tags. Links can:
link to another document
link to another part of the same document
In this case, clicking triggers an action, you should use a <button type="button"> tag.

Bootstrap 4 and user details - how to do the "bootstrap" or correct way?

I am working on a layout using bootstrap 4 alpha (really like the cards feature btw).
So, I have this area within the layout where I want the phone and email info to be placed on the same line. I'm no css guru and know barely enough to be dangerous. So, I'm unsure how to achieve the effect I'm after and do so correctly. Any tips or advice is greatly appreciated.
Here is the code I currently have:
<div class="media">
<div class="media-left">
<a href="#">
<img class="media-object" src="img/avatars/adelle.jpg" alt="Generic placeholder image">
</a>
</div>
<div class="media-body">
<span class="favorite"><i class="fa fa-star"></i></span>
<h6 class="media-heading">Jacqueline Perry</h6>
<span class="company">Domino Technologies</span>
<div class="row">
<div class="col-xs-12 col-sm-6 col-md-8">
<ul class="details">
<li class="phone"><i class="fa fa-mobile fa-lg fa-lg"></i> (123) 786-4533 </li>
<li class="email"><i class="fa fa-paper-plane-o"></i> jacqueline.perry#smithcorporation.com</li>
<li class="address"><i class="fa fa-map-marker"></i> 338 West 23rd Street New York, NY 10011, USA </li>
</ul>
</div>
</div> <!-- ./row -->
</div>
</div>
What I'm trying to achieve is this (see image below)
http://jsfiddle.net/hamzanisar/d1mdm2tk/3
Maybe this will work for you. Just re-size the view port and it will be one line for responsive you can adjust as you want. I'm using row and col-*-* because with row and col-*-* its possible otherwise you need to make custom css

Back button does not work in header using Framework 7 and intel xdk

I am using Framework7 in intel xdk. I need to add back button or link that do the slide transition in the header navbar. I add the following in the html file but the back link does not work.
<div class="navbar">
<div class="navbar-inner">
<div class="left">
<a href="#" class="link">
<i class="icon icon-back"></i>
<span>Back</span>
</a>
</div>
<div class="center">Center</div>
<div class="right">
<a href="#" class="link">
<i class="icon icon-bars"></i>
<span>Menu</span>
</a>
</div>
</div>
To do that you need class back.
Go back
You can find more information here, but I recommend you to read all documentation, not only this section.
In version 3400, just drag the button to the left corner header and when to stay "focused" (orange color) and drop! Then set the button properties.

Fitting elements for Splash Page on mobile in BootStrap

I'm trying to create a responsive splash page, but it's not responding, no matter how much I try to manipulate it. What I'm mostly trying to do is fit the image with no margin or padding. I want it similar to Adele's mobile site. Also, I'm not sure if the code is clean and I'm naming the classes correctly. I created a codepen so you can check it out there.
<div class="featurette">
<img class="featurette-image img-responsive pull-left center-block" src="http://www.placehold.it/400/F84065/000" alt="#">
<div class="purchase-album">
<div class="album">
<img class="img-responsive" src="http://www.placehold.it/200/fa8ca2" />
<div class="lead">available now:</div>
</div>
<div class="space">
</div>
<p class="lead text-center available "></p>
<a href="#" target="_blank">
<button type="button" class="btn btn-default btn-lg outline" type="submit">iTunes</button>
</a>
<a href="#" target="_blank">
<button class="btn btn-default btn-lg outline" type="submit">loudr</button>
</a>
</div>
</div>
<div class="enter">
<button type="button" class="btn btn-default btn-lg outline" type="submit">
enter
</button>
</div>
</div>
Adeles page is a background image with the content displayed on top.
You can achieve this in many ways.
Try using this and playing about with the CSS to get everything in the desired place.
codepen here example
<header>
<div class="overlay">
<div class="header-content">
<div class="header-content-inner">
<h1>Your image here</h1>
<p>buttons here etc</p>
</div>
</div>
</div>
Shrink the page to see the responsive-ness