I wrote a website for a travel based start up. It is a static website, not a responsive website. The code is here.
Code:
<div id="mainDiv" class="container">
<div id="header">
<div class="plc">
<h1></h1>
<nav>
<div id="navPos">
<div style="position: relative;right: 113px;">Register</div>
<div style="position: absolute;right: 255px;top: 37px;">Login</div>
<div style="position: absolute;top: 38px;right: 123px;">Market</div>
</div>
</nav>
</div>
</div>
<div id="body" class="container-fluid">
<div id="container">
<div id="overlay"></div>
<div id="menu"></div>
<div id="info">Fill your information here</div>
<div id="formPos"></div>
<div id="or">OR</div>
<div id="fbReg">
<img src="images/fbOne.png" id="fbIcon">
<div id="fbPos">Register with Facebook</div>
</div>
<div id="gReg">
<img src="images/gPlus.jpg" id="gIcon">
<div id="gPos">Register with Google</div>
</div>
<div id="cliPos">
<img src="images/Bistip-in-media.png" id="imgCli">
</div>
</div>
</div>
<div id="footer">
<div id="aboutUs">
About Us
</div>
<div id="aboutList">
<ul>
<li>About us</li>
<li>Media reviews</li>
<li>Bistip guide</li>
</ul>
</div>
<div id="accountInformation">
Account Information
</div>
<div id="accountList">
<ul>
<li>How to login</li>
<li>Create an account</li>
<li>Logout</li>
<li>Join us</li>
</ul>
</div>
<div id="marketInformation">
Market Information
</div>
<div id="marketList">
<ul>
<li>Shop</li>
<li>Shipping</li>
<li>My connection</li>
</ul>
</div>
</div>
</div>
Website in full screen browser appears like this:
Browser is resized like this:
You can see that elements are mixed up. How can I fix this?
This is because you are using position absolute in some elements.
You could try to use bootstrap.css and take off all the positions that you are using.
Related
Hi. My portfolio nav menu (list items) no longer functions in Safari and Chrome, but works in Firefox. The creator of this template is no longer available for support. Purchased 5 years ago.
Suggestions (for dummies) to make the anchors work are appreciated. BHNTR.com
———
<div id="main-menu">
<div class="container">
<div class="row">
<div class="hidden-md hidden-lg" id="mobile-menu-button">
<i class="fa fa-bars"></i>
</div>
<div class="col-sm-2 col-lg-2">
<div id="logo-container">
<img src="assets/img/bhntr-logo.svg" alt="bhntr logo">
</div>
</div>
<div class="col-sm-10 col-lg-10">
<nav id="desktop-menu" class="hidden-sm hidden-xs">
<ul>
<li>HOME</li>
<li>ABOUT</li>
<li>SERVICES</li>
<li>WORK SAMPLES</li>
<li>CONTACT</li>
</ul>
</nav>
</div>
</div>
</div>
————
I'm using Bootstrap and my issue is that the content (ul) within the "forecastDiv" is not inside the "forecastDiv" border. The content stays inside the border once I remove Bootstrap's grid system but I need to align my content properly so I need to be using the grid system. Below is the code I have in a codepen (go to "6-day forecast" comment in HTML). Any help is appreciated. Thank you.
HTML
<div id="forecastDiv">
<div class="col-md-1" id="boxInfo0">
<p id="forecast0">0
</p>
<p id="forecast0TempC">0
</p>
<p id="day0">Test
</p>
</div>
<div class="col-md-1" id="boxInfo1">
<p id="forecast1">0
</p>
<p id="forecast1TempC">0
</p>
<p id="day1">Test
</p>
</div>
<div class="col-md-1" id="boxInfo2">
<ul id="forecast2">0
</ul>
<ul id="forecast2TempC">0
</ul>
<ul id="day2">Test
</ul>
</div>
<div class="col-md-1" id="boxInfo3">
<ul id="forecast3">0
</ul>
<ul id="forecast3TempC">0
</ul>
<ul id="day3">Test
</ul>
</div>
<div class="col-md-1" id="boxInfo4">
<ul id="forecast4">0
</ul>
<ul id="forecast4TempC">0
</ul>
<ul id="day4">Test
</ul>
</div>
<div class="col-md-1" id="boxInfo5">
<ul id="forecast5">0
</ul>
<ul id="forecast5TempC">0
</ul>
<ul id="day5">Test
</ul>
</div>
</div> <!-- end forecastDiv -->
CSS
#forecastDiv {
width: 100%;
border: solid black;
margin: 0 auto; }
https://codepen.io/mcmaster-99/pen/ybWvyy
add a "container" or "container-fluid" class to your <div id="forecastDiv">. "container" is a bootstrap class that will keep everything inside the div.
<div class="container" id="forecastDiv">
Im working on a website that uses the meanmenu, and Ive been struggling for two days on how to get a title to appear inside the mean menu container.
heres my html for the menu:
<div class="row">
<div class="col-lg-4 col-md-8 col-sm-4">
<h2>Title Text</h2>
</div>
<div class="col-lg-8 col-md-12 col-sm-12 hidden-xs">
<div class="main-menu float-right">
<nav>
<ul>
<li class="active">Home</li>
<li>About Us</li>
<li>What We Do</li>
<li>Our Work</li>
<li>Contact Us</li>
</ul>
</nav>
</div>
</div>
<div class="hidden-sm hidden-lg hidden-md col-sm-2">
<div class="mobile-menu">
<nav>
<ul>
<li class="active">Home</li>
<li>About Us</li>
<li class="hidden-xs">What We Do</li>
<li>Our Work</li>
<li>Contact Us</li>
</ul>
</nav>
</div>
</div>
</div>
</div>
Heres how it looks expanded:
Collapsed I can't figure out how to get it to stay inline:
I've seen a few posts on similar issues but nothing has worked for me. Im wondering if anyone has done this before?
This happens because you use bootstrap classes not in a right manner
This should works (hope so, because you hide .css from us :) )
<div class="row">
<div class="col-xs-6 col-sm-4 col-md-8 col-lg-4">
<h2>Title Text</h2>
</div>
<div class="visible-xs col-xs-6">
<div class="mobile-menu">
</div>
</div>
</div>
maybe cuz u didnt set col-xs-* grids for your Title Text ( hence its taking 12 columns) try that and if possible please post a jsfiddle :)
I have some troubles with my footer on a website. Footer is not displaying at the bottom of the page but it starts right below the header and covers elements that are under it. For better understanding I made fiddle for it and screenshot
But its like this:
<div class="mens">
<div class="main">
<div class="wrap">
<div class="section group">
<div class="cont span_2_of_3">
<h2 class="head">PRIPOROČAMO</h2>
<div class="top-box">
and then there are some products and then there are the end divs for this:
</div>
</div>
</div>
</div>
</div>
</div>
And then follows the footer:
<footer class="footer-2 bg-midnight-blue">
<div class="container">
<nav class="pull-left">
<ul>
<li class="active">
Home
</li>
<li>
Company
</li>
<li>
Portfolio
</li>
<li>
Blog
</li>
<li>
Contact
</li>
</ul>
</nav>
<div class="social-btns pull-right">
<div class="fui-vimeo"></div><div class="fui-vimeo"></div>
<div class="fui-facebook"></div><div class="fui-facebook"></div>
<div class="fui-twitter"></div><div class="fui-twitter"></div>
</div>
<div class="additional-links">
Be sure to take a look to our Terms of Use and Privacy Policy
</div>
</div>
</footer>
And I know its a lot of code but I would really appreciate if someone could look at it. Thanks.
use this to reset ur css
.clearfix:before,.clearfix:after{content: '.';display: block;overflow: hidden;visibility: hidden;font-size: 0;line-height: 0;width: 0;height: 0;clear: both;}
.clearfix {overflow: auto;zoom: 1;}
and add clearfix class in parent div where in child u have used float like in
<div class="page-wrapper clearfix">
<div class="main clearfix">
<footer class="footer-2 bg-midnight-blue clearfix">
In my HTML5 / JQueryMobile app, I use several data-role="page" divs in the same index.html file:
<body>
<!-- Map page -->
<div data-role="page" data-theme="b" id="map">
<div data-role="header" data-theme="b">
<h1>Map</h1>
</div>
<div data-role="content">
<div id="map_canvas" style="width:320px; height:300px; float:left; border: 1px solid black;">
</div>
</div>
<div data-role="footer" data-position="fixed">
<div data-role="navbar">
<ul>
<li>Map</li>
<li>List</li>
<li>Settings</li>
</ul>
</div>
</div>
</div>
<!-- List page -->
<div data-role="page" data-theme="b" id="list">
<div data-role="header" data-theme="b">
<h1>List</h1>
</div>
<div data-role="content">
…
</div>
<div data-role="footer" data-position="fixed">
<div data-role="navbar">
<ul>
<li>Map</li>
<li>List</li>
<li>Settings</li>
</ul>
</div>
</div>
<!-- Settings page -->
<div data-role="page" data-theme="b id="settings">
<div data-role="header" data-theme="b">
<h1>Settings</h1>
</div>
<div data-role="content">
...
</div>
<div data-role="footer" data-position="fixed">
<div data-role="navbar">
<ul>
<li>Map</li>
<li>List</li>
<li>Settings</li>
</ul>
</div>
</div>
</div>
</body>
This code does not work very nicely. The selected item of the navigation is not well highlighted after several clicks.
Is this page structure (several data-role="page" in the body) the correct way to do ?
UPDATE
Seems to be the way to do it (http://jquerymobile.com/demos/1.0a1/#docs/pages/docs-pages.html), so I must miss something.
You're using Alpha version 1, they have improved much with Alpha version 4: http://jquerymobile.com/demos/1.0a4.1/#docs/pages/docs-pages.html
You might also have a look at the toolbar section as well:
http://jquerymobile.com/demos/1.0a4.1/#docs/toolbars/index.html
Demo: http://jsfiddle.net/jAwPR/3/