first time user of Foundation framework, I've developed all my previous websites with Bootstrap but now I'm forced to built one website with foundation. I noticed they are pretty similar but somehow different frameworks.
I've encountered a problem and hope you can help me with this.
I need to add a banner to a website which is full width and text which is within the grid and has a bg which is also full width, see what I mean here:
Here is my html:
<div class="fullWidth">
<div class="banner">
<div class="logo">
<img src="images/logo.svg"/>
</div>
<div class="row">
<div class="bg-tagline">
<h1 class="tagline">some text here</h1>
</div>
</div>
</div>
</div>
and the css:
.fullWidth {
width: 100%;
margin-left: auto;
margin-right: auto;
max-width: initial;
}
.banner {
background: white url("images/baner.jpg") no-repeat center;
height: 590px;
background-size: cover;
position: relative;
}
.logo {
position: relative;
padding: 1%;
height: 5em;
width: 5em;
}
.bg-tagline {
color: #fff !important;
background-color: white;
width: 100%;
margin: 0px auto;
}
.bg-tagline h1 {
color: #fff !important;
font-size: 1.2em;
text-align: center;
}
As far as I know, there's no a "full width" class in foundation framework; Normally, in those layout types, I'd just use the elements off the framework, for instance:
<header id="banner">
<div class="slogan">Your text banner here</div>
</div>
And of course some CSS like you have already. If you need something elaborated (like a layout using foundation's classes), I'd put inside div.slogan a div.row, and start building layout from there, of course that row would be restricted to the max width from the framework.
BTW, if you need to have the entire framework having a wider width for the rows, you can change the framework settings and re-compile.
Personally, I like to make utility class for rows:
.row.fullwidth {
max-width:100em; // set your override width here
margin: 0 auto;
}
That way whenever I need a full width section I just do:
<div class="row fullwidth">
<!--- content --->
</div>
Related
Context:
I am trying to create 3 charts on 1 row (each has a minimum width) such that on window resize, the charts should also resize and may go to next row depending on the browser total width.
Problem:
Currently, I am missing something in the css because the chart is overflowing within the demo container below. The tooltip looks fine, but only half of the chart is seen in the container and both the axes are also hidden.
Has someone implemented something similar before? I want to understand how to load the charts in the div.
P.S. In the code below, highcharts-container is the inbuilt div which contains the charts. I am using the latest version of Highcharts and Angular 7.
My current html code -->
<div class="container-fluid">
<div class="row">
<div class="col-lg-4 col-md4 demo>
<div class="demo-container">
<highcharts-chart [Highcharts]="Highcharts" [options]="options1" [callbackFunction]="cb1">
</highcharts-chart>
</div>
</div>
<div class="col-lg-4 col-md4 demo>
<div class="demo-container">
<highcharts-chart [Highcharts]="Highcharts" [options]="options2" [callbackFunction]="cb2">
</highcharts-chart>
</div>
</div>
<div class="col-lg-4 col-md4 demo>
<div class="demo-container">
<highcharts-chart [Highcharts]="Highcharts" [options]="options3" [callbackFunction]="cb3">
</highcharts-chart>
</div>
</div>
</div>
</div>
My css code (The main part) -->
.container-fluid{
width:100%
}
.demo{
margin: 20px 0;
min-width: 448px;
}
.demo-container{
position: relative;
border: 1px solid transparent;
box-shadow: 0 0 20px #1793f5;
width: 100%;
height: 100%;
}
.highcharts-container{
height: 100% !important;
width: 100% !important;
display: inline-block;
vertical-align: middle;
}
You could try to include the following CSS as a part of demo-container or container-fluid... one of it should do the deal for you.
height: 100% !important;
width: 100% !important;
Update
one of the harder challenges i have encountered, but add this to the style.css
and you have your contents dynamic inside its container.
.highcharts-background, .highcharts-root, .highcharts-container {
max-height: 100%;
max-width: 100%;
}
is this what you are looking for?
This was made using images of the graphs in the links you posted. I also used flexboxes which seems to be what you are looking for.
https://css-tricks.com/snippets/css/a-guide-to-flexbox/
.container-fluid div {
width: auto;
border: 2px solid red;
min-width: 33%;
}
.container-fluid{
display: flex;
flex-wrap: wrap;
border: 2px solid blue;
justify-content: center;
}
<div class="container-fluid">
<div class="chartOne">
<img src="https://i.gyazo.com/161954d0841b7a398d5f0d63e1b2bcc4.png" alt="">
</div>
<div class="chartOne">
<img src="https://i.gyazo.com/161954d0841b7a398d5f0d63e1b2bcc4.png" alt="">
</div>
<div class="chartOne">
<img src="https://i.gyazo.com/161954d0841b7a398d5f0d63e1b2bcc4.png" alt="">
</div>
</div>
this is how it looks on desktop
I have an image that has the full width of the screen width: 100%;
Specifically this image is a map, in the whole center of the map there is a "path", with the points that when clicking, some manners appear,
The problem is that I don't know how to make that huge sensitive map so that it can be seen well on different devices, what I was thinking is what an overflow is but I really don't know how to do it so only the left part of the image is shown
This is the code:
.map-container {
padding: 3.2rem .8rem;
position: relative;
display: inline-block;
margin: 0 auto;
background-color: $blue;
}
.img-map {
width: 100%;
}
<div class="container-fluid">
<div class="row">
<div class="map-container">
<img class="img-map" src="public/images/mapa.svg">
<div id="step1" class="point argentina"></div>
<div id="step2" class="point brasil"></div>
<div id="step3" class="point venezuela"></div>
<div id="step4" class="point colombia"></div>
<div id="step5" class="point panama"></div>
<div id="step6" class="point mexico"></div>
<div class="mod-paso-1">
<div class="mod-info">
<p><b>XXXXXXXXXX</b></p>
<p><b>XXXXXXXXX</b></p>
<p><b>XXXXXXXX</b></p>
<P>XXXXX</P>
</div>
</div>
</div>
</div>
</div>
You who recommend me to make this map responsive?
"-Cut the image for each resolution?"
If you need more details, I am attentive
Thanks in advance.
Add 100% width to your map container so the image width can take 100% of the screen whether on desktop or mobile:
.map-container {
width: 100%;
padding: 3.2rem .8rem;
position: relative;
display: inline-block;
margin: 0 auto;
background-color: blue;
}
May be this would help you
.img-map {
width: 100%;
height: 100%;
object-fit: contain;
}
I've also tried to fiddle around a bit with this issue.
you will have to open on mobile view because I only focused on that for now.
Here is the codepen
https://codepen.io/Spoochy/pen/LYYQzPv
I combined object-fit:cover and viewport heights
However, object-fit is quite new (as far as I know) and might not be fully compatible for all browsers. so I would suggest to always check the Can I use Tables before using unknown properties.
https://caniuse.com/#search=object-fit
How can I make all divs with different heights bunch together vertically whilst having them in columns? Each of the divs in my website float left with a 5px margin on the right and bottom so that two columns are made but with them all different heights the bottom margins are different depending on the tallest div in that row, how can I make them bunch up like on this Google Now page?
I have made a basic version of my website in JSFiddle.
<div id="container">
<div id="tile" class="tile-1"></div>
<div id="tile" class="tile-2"></div>
<div id="tile" class="tile-3"></div>
<div id="tile" class="tile-4"></div>
<div id="tile" class="tile-5"></div>
<div id="tile" class="tile-6"></div>
</div>
#container {
width: 210px;
height: auto;
overflow: auto;
}
#tile {
width: 100px;
margin: 0 5px 5px 0;
background-color: #333;
float: left;
}
.tile-1 { height: 100px; }
.tile-2 { height: 130px; }
.tile-3 { height: 80px; }
.tile-4 { height: 100px; }
.tile-5 { height: 110px; }
.tile-6 { height: 150px; }
I have done it previously by making each column have their own container but when the browser window shrinks I need the 'tiles' to merge but keep their order, going from reading the page like a book to reading it like a list for smaller screens.
Thanks in advance.
Matt
Use one of these
Isotope (probably most popular)
Masonry
jQuery.waterfall
Wookmark jQuery plugin
See examples and you will achieve this easily.
So to start this off I would like to just say that any help is appreciated, I'm not looking for the entire code laid out for me. I have tried to create this but fail every time as something disappears of it breaks the entire layout of the page. I am fairly new to programming but I have a pretty good grasp of concepts and I'm open to learning new things.
I would like to create a top bar like in this website, with the logo and social icons. No search bar.
http://www.complex.com/
Thank you to anyone for any help
First, as a general tip: Whenever you see something you want to recreate, right click on it in chrome and select "inspect element". Then you can look at the css used to create it.
To have social icons up like your example site, they've simple floated them right.
So HTML:
<div class="header">
<div class="leftThing">
</div>
<div class="rightThing">
</div>
</div>
CSS:
.leftThing { float:left;}
.rightThing { float:right;}
The float will cause the element to go as far to the side you select as it can, then sit there. Here is a good css tricks article on the concept: http://css-tricks.com/all-about-floats/
I made you a litte JS-Fiddle to show you how to fix the header on top of the screen when you scroll down. Hope it helps a bit!
HTML:
<div id="WebContent" class="Content">
<img src='http://apod.nasa.gov/apod/image/9712/orionfull_jcc_big.jpg'></img>
</div>
CSS:
.Header{
top: 0px;
left: 0px;
min-height: 50px;
max-height: 50px;
min-width: 1024px;
background-color: #2C2C2C;
color: white;
position: fixed;
}
.icon{
height: 50px;
}
.Content{
max-width: 300;
max-height: 300;
overflow-y: auto;
}
Fiddle: http://jsfiddle.net/wujood/pgqeLr7s/
Or you can just insert a fixed position to your header:
<div class="header" style="position:fixed">
<div class="leftThing">
</div>
<div class="rightThing">
</div>
</div>
Apply either CSS float: left or display: inline-block to your elements.
http://jsfiddle.net/njoh7x73/
CSS code
.menu {
background-color: #333;
}
.menu div.item {
width: 64px;
height: 16px;
background-color: #888;
}
.menu .item {
float: left;
padding: 10px;
margin: 5px;
}
.menu .item:hover {
background-color: #555;
}
HTML code
<div class="menu">
<a class="item" href="#">LINK</a>
<div class="item"></div>
<a class="item" href="#">LINK</a>
<div class="item"></div>
<div style="clear:both"></div>
</div
If you use this approach (floating elements), don't forget to clear them.
Hi Guys I have this site:
http://www.ryansammut.com/orijen/
Basically so far I managed to make the top part strech as a background, now I need to make the other parts too. I'm not sure how to do it, so I'm asking for ideas how this would be done best, keeping the positioning all relative and the background image would adjust according to the needed content area.
PS. This is only needed for resolutions greater than 1280px, so zoom out if you need to see what's happening.
You can not stretch those elements because they are contained in a div named 'wrapper', which has a maximum width of 1280px.
add the following properties to : header, contentbackground, and footer:
margin-left:auto;
margin-right:auto;
this will make sure the elements are centered.
then remove the width property from #wrapper, and add the background to it so it reads as follows :
#wrapper {
position: relative;
margin: 0 auto;
top: 0px;
padding: 0px;
background-image: url(../images/contentBG.png);
}
However, now we won't see the horizontal stretch of the header anymore, so we need to move #header above #wrapper.
<div id="header">
...
</div>
<div id="wrapper">
...
</div>
Don't use tables, use DIVs only.
No need to include FlowPlayer script two times.
I dont see you use JQuery (no need to include that).
Replace Dreamweaver's rollover images with proper CSS:
.item {background: image.jpg}
.item:hover {background: image_rollover.jpg}
Get sprite images (you can read here: http://css-tricks.com/css-sprites/)
As the original question... you have to use two DIVs for each "row", like this:
#header_wrapper {
float: left;
width: 100%;
background: header_backgroud.jpg;
}
#menu_wrapper {
float: left;
width: 100%;
background: menu_backgroud.jpg;
}
#content_wrapper {
float: left;
width: 100%;
background: content_backgroud.jpg repeat center top;
}
.wrapper {
margin: 0 auto;
width: 1260px;
}
<div id="header_wrapper">
<div class="wrapper">
--- header content ---
</div>
</div>
<div id="menu_wrapper">
<div class="wrapper">
--- menu content ---
</div>
</div>
<div id="content_wrapper">
<div class="wrapper">
--- page content ---
</div>
</div>
You need to change the structure to something like this:
<div id="header">
<div>
<ul>Nav</ul>
</div>
</div>
<div id="mainContent">
<div>Content</div>
</div>
<div id="footer">
<div>Content</div>
</div>
Then the CSS could look something like this:
div#header { width: 100%; background: black; }
div#header div { width: 600px; margin: 0 auto; background: url(...); }
div#mainContent { width: 100%; background: url(...); }
div#mainContent div { width: 600px; margin: 0 auto; }
div#footer { width: 100%; background: black; }
div#footer div { width: 600px; margin: 0 auto; }
It is fast written, hope you can see the idea? I can't see why you would go with position absolute or relative. Use margin: 0 auto; to center divs instead :)