Weird <section> Behaviour in Twitter Bootstrap - html

I have been working with the Twitter Bootstrap on a mini project. I am using 's with it and there is a bit of weird behaviour. I have jQuery which allows me to create new tabs when a button is clicked. The new tab is made active and contains a form. This form displaces the title of the below and I can't find out why. Can anyone help?
Code Snippets:
<section id="builder">
<div class="page-header">
<h1>App Builder. <small>Create your app.</small></h1>
</div>
<div class="span7">
<!-- ===== App Title ===== -->
<div class="control-group">
<label class="control-label" for="appTitle">App Title</label>
<div class="controls">
<input type="text" class="input-xlarge" id="appTitle">
<p class="help-block">Enter the title for your app. It will appear at the top of your app.</p>
</div>
</div>
<!-- ===== App Subtitle ===== -->
<div class="control-group">
<label class="control-label" for="appSubtitle">App Subtitle</label>
<div class="controls">
<input type="text" class="input-xlarge" id="appSubtitle">
<p class="help-block">Enter the subtitle for your app. It will appear below the title.</p>
</div>
</div>
<!-- ===== App Theme ===== -->
<div class="control-group">
<label class="control-label" for="appTheme">App Theme</label>
<div class="controls">
<select id="appTheme">
<option>Dark</option>
<option>Light</option>
</select>
<p class="help-block">Select the theme for your app. You can preview your theme on the right.</p>
</div>
</div>
<!-- ===== App Pages ===== -->
<p>App Pages</p>
<ul class="nav nav-tabs" id="tabHeaders">
<li><i class="icon-plus"></i>Add Page</li>
<!-- Tabs (Created by Javascript) -->
</ul>
<div class="tab-content" id="tabContent">
<!-- Tab Content (Created by Javascript) -->
</div>
</div>
<div class="span4">
<div class="iphonebackground">
<div class="screenbackground"></div>
</div>
</div>
</section>
<section id="preview">
<div class="page-header">
<h1>Preview your App. <small>See your app in it's full glory before you download it.</small></h1>
</div>
</section>
Before adding a new tab:
After adding a new tab:

It looks like the text is being floated around the new tab. Try using clear:left; in the CSS for that text to see if it correctly drops back below the tab.

Related

Include HTML page with jQuery.load, search button no response

I take out the codes related to menu area (as shown below) from index.html to an independent file header.html,
and then include header.html into index.html with,
<body>
<div id="header"></div>
...
<script>
$("#header").load("header.html");
</script>
</body>
However, when I click the search button, there is no response. Originally, a search box should appear as shown below.
The related codes are listed below, (the complete example is here)
<!-- page search box -->
<div class="page_search_box">
<div class="search_close">
<i class="ion-close-round"></i>
</div>
<form class="border-bottom" action="#">
<input class="border-0" placeholder="Enter keyword..." type="text" />
<button type="submit"><i class="ei ei-search"></i></button>
</form>
</div>
<div class="main_header_right d-flex align-items-center">
<div class="header_account">
<ul class="d-flex">
<li class="header_search"> <i class="ei ei-search"></i> </li>
</ul>
</div>
<div class="canvas_open">
<i class="ion-navicon"></i>
</div>
</div>
What's wrong?

Why is my modal-header and modal-footer causing my websites layout to mess up

I have created a basic site with a grid layout and and a modal with a login form. However, I noticed after adding tags for the modal header and footer the layout completely screws up and leaves a large gap in the middle. The page currently looks like
The expected outcome for the page should be like here:
https://codepen.io/mor10/pen/QvmLpd
and if I do not include the modal footer and header tags it works as expected. The current code for and surrounding the modal is this:
Code for sake of being able to post with codepen link:
<main id="content" class="main-content">
<!-- Modal for logging in -->
<h2>Main content area</h2>
<p>The main content area is where the magic happens. Right now, the main content is on the left and the sidebar is on the right. If you go into the markup for this document and add <code>dir="rtl"</code> to the <code>html</code> element, the two elements will swap spaces because CSS Grid honors text direction.</p>
<div id="loginModal" class="modal">
<div class="modal-content">
<div class="modal-header">
<span class="close">×</span>
<h2>Login</h2>
</div>
<div class="modal-body">
<form action="" method="">
<label for="fname">Username:</label><br>
<input type="text" id="user"><br>
<label for="lname">Password:</label><br>
<input type="text" id="password"><br><br>
<input type="submit" value="Login">
</form>
<p>Don't have an account?</p><p>Create one</p>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>
</main>
It's very strange to me that the modal is affecting the layout, but only when the header and footer of the modal are used. On previous sites I have made, I have used multiple modals and not had this issue.
You have a closing </div> tag without an opening one:
<main id="content" class="main-content">
<!-- Modal for logging in -->
<h2>Main content area</h2>
<p>The main content area is where the magic happens. Right now, the main content is on the left and the sidebar is on the right. If you go into the markup for this document and add <code>dir="rtl"</code> to the <code>html</code> element, the two elements will swap spaces because CSS Grid honors text direction.</p>
<div id="loginModal" class="modal">
<div class="modal-content">
<div class="modal-header">
<span class="close">×</span>
<h2>Login</h2>
</div>
<div class="modal-body">
<form action="" method="">
<label for="fname">Username:</label><br>
<input type="text" id="user"><br>
<label for="lname">Password:</label><br>
<input type="text" id="password"><br><br>
<input type="submit" value="Login">
</form>
<p>Don't have an account?</p><p>Create one</p>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div> <!-- this should be removed -->
</main>

Code for uploading a video on my web page

I have a code for a web page, which can handle image uploading, but not video uploading. The page is built using Javascript and Html. This is the HTML code for the page to post a new picture. Would it be different for a video page? And also, do I need to update my JS code too?
<!-- Post new pic page -->
<section id="page-add" class="mdl-grid fp-content" style="display: none;">
<div class="mdl-cell mdl-cell--12-col mdl-cell--12-col-tablet mdl-grid mdl-grid--no-spacing">
<div class="fp-addcontainer mdl-card mdl-shadow--2dp mdl-cell mdl-cell--12-col mdl-cell--12-col-tablet mdl-cell--12-col-desktop">
<div class="fp-overlay">
<i class="material-icons">hourglass_full</i>
</div>
<img id="newPictureContainer" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==" alt="New Picture to Upload">
<div class="mdl-card__supporting-text mdl-color-text--grey-600">
<form id="uploadPicForm" action="#">
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<input class="mdl-textfield__input" type="text" id="imageCaptionInput">
<label class="mdl-textfield__label" for="imageCaptionInput">Image caption...</label>
</div>
<br />
<button type="submit" class="fp-upload mdl-button mdl-js-button mdl-button--raised mdl-color--amber-400">
Upload this pic!
</button>
</form>
<div class="fp-legalese-add">
All uploaded pictures will be publicly viewable, and must adhere to the Terms of Service.
</div>
</div>
</div>
</div>
</section>

Static webpage textarea not responding to keyboard input on Twitter Bootstrap example

I am working on a static webpage (using the Twitter Bootstrap carousel example), and the webpage contains a form. I am trying to put the form over the carousel image, but when I do this, the user cannot type in text to the input textarea. I tested this on Chrome and Safari on both my laptop and mobile, and the textbox is always unresponsive to changes. Naturally curious, I looked at W3 School's carousel example, and even on that, no text goes in the textbox when the user types. Here is the link to W3Schools in case you want to try it and see:
http://www.w3schools.com/bootstrap/tryit.asp?filename=trybs_carousel2&stacked=h
Does anyone know what could be causing this behavior?
My code is listed below:
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active">
<img class="first-slide" src="images/placeholder.jpg">
<div class="container">
<div class="carousel-caption">
<center>
<h1>Behavioral therapy outside the clinician's office.</h1>
<p>
<div class="img-rounded" style="background-color: black; margin-left: 10px; margin-right: 10px;">
<br>
<form class="form-inline" role="form" background="black">
<div class="form-group">
<label for="email">Name:</label>
<input type="email" class="form-control" id="name">
</div>
<div class="form-group">
<label for="email">Email:</label>
<input type="email" class="form-control" id="email">
</div>
<button type="submit" class="btn btn-primary">Sign up today</button>
</form>
</br>
</div>
</p>
</center>
</div>
</div>
</div>
</div>
</div>
So it turns out that the problem was the version of Bootstrap used! I was using the version 4 alpha version of Bootstrap, which apparently is still buggy. Switching to Bootstrap 3.3.5 fixes the problem.
(Thanks to brbcoding for pointing this out!)

Left navigation menu disappearing when main page content loads, why?

This is driving me nuts....as per this page http://kudosoo.com/twofolio.html
there is an issue with the left nav working correctly.The top part of the menu disappears upon loading. I've tried adjusting the css and html in different ways to solve this but nothing has worked to date.
I believe its linked to the either the #container or how the drop dwon menu is showing on the page, seems to be sitting on top of the menu.
Any help is gratefully received.
Main page code is below. Example page is here
<div id="preloader">
<div id="status">
<p class="center-text">
Loading the content...
<em>Loading depends on your connection speed!</em>
</p>
</div>
</div>
<div class="all-elements">
<div id="sidebar" class="page-sidebar">
<div class="page-sidebar-scroll">
<div class="sidebar-controls">
</div>
<div class="sidebar-header">
<img class="sidebar-logo round-decoration" src="images/general-nature/8s.jpg" alt="img">
<h4 class="center-text">kudosoo</h4>
<em class="center-text">Get badged today</em>
</div>
<div class="sidebar-breadcrumb">
<div class="sidebar-decoration"></div>
<p>Navigation</p>
<div class="sidebar-decoration"></div>
</div>
<div class="navigation-items"></div>
<div class="nav-item">
Home<em class="unselected-nav"></em>
</div>
<div class="sidebar-decoration"></div>
<div class="nav-item">
Activity<em></em>
<div class="nav-item-submenu active-submenu">
<div class="sidebar-decoration"></div>
Received <em class="unselected-sub-nav"></em>
Awarded <em class="unselected-sub-nav"></em>
Friends <em class="unselected-sub-nav"></em>
</div>
</div>
<div class="sidebar-decoration"></div>
<div class="nav-item">
Select Badge<em class="dropdown-nav"></em>
<div class="nav-item-submenu">
<div class="sidebar-decoration"></div>
Wide item Portfolio <em class="selected-sub-nav"></em>
</div>
</div>
<div class="sidebar-decoration"></div>
<div class="nav-item">
My Profile<em class="unselected-nav"></em>
</div>
<div class="sidebar-decoration"></div>
<div class="nav-item">
Close<em class="unselected-nav"></em>
</div>
</div>
<div class="sidebar-breadcrumb">
<div class="sidebar-decoration"></div>
<p>Let's get social!</p>
<div class="sidebar-decoration"></div>
</div>
<div class="navigation-items">
<div class="nav-item">
Facebook<em class="link-nav"></em>
</div>
<div class="sidebar-decoration"></div>
<div class="nav-item">
Twitter<em class="link-nav"></em>
</div>
</div>
<div class="sidebar-decoration"></div>
<p class="sidebar-copyright center-text">Copyright 2014.
<br>All rights reserved.</p>
</div>
</div>
<div id="content" class="page-content">
<div class="content-controls solid-color fixed-header">
<em class="content-title">Who's getting Kudosoo today?!</em>
LogOut
</div>
<div class="fixed-header-clear"></div>
<!---HTML code not to change ends-->
<div class="content">
<div id="container">
</div>
<!--Search options to find firends, requests and rejections-->
<div id="friendsfilter">
<form id="friendsfilter">
<div class="error" style="display:none"></div>
<div class="form-group">
<div class="input-group input-group-hg input-group-rounded">
<span class="input-group-btn">
<button id="find_button" type="button" class="btn"><span class="fui-search"></span>
</button>
</span>
<input type="text" id="friendsearch" placeholder="Find Friend" class="form-control" />
</div>
</div>
<select name="huge" class="btn-group select select-block mbl select-multiple" id="s_Friends">
<option value="0">Click to manage friend connections</option>
<option value="f_connected">Friends</option>
<option value="f_requests">Requests</option>
<option value="f_rejected">Declined</option>
<option value="f_sent">Sent</option>
</select>
<div id="FriendsConnected"></div>
<div id="FriendsPending"></div>
<div id="FriendsRejected"></div>
<div id="FriendsSent"></div>
</form>
</div>
<!--Friends profile info and stats-->
<div id="container friendsProfile">
<form>
<div class="error" style="display:none"></div>
<button id="friendsProfile" class="button button-red">Unfriend</button>
</form>
</div>
<!--Displays a blank no user image on the page if no matches are found in the parse database or displays an image of the user if a match is found-->
<div id="container">
<img style="display:none" src="/img/no-user.png" id="no_user" alt="No user found" class="BadgeImgOutline responsive-image">
<div id="userimgs"></div>
</div>
<div id="container" class="container no-bottom">
<!---List of connected friends is generated from script below, the different divs split the results depending which button is clicked-->
<div id="containerFriends"></div>
<div id="containerFriendsPending"></div>
<div id="containerFriendsRejected"></div>
<div id="containerFriendsRequestSent"></div>
<div id="containerFriendsConnected"></div>
<div id="containerFriendsProfile"></div>
</div>
<!--Displays friends uploaded badges after the user clicks on their profile picture-->
<div id="container">
<div id="badgeimgs"></div>
</div>
</div>
</div>
</div>
</div>
<!--Footer stuff-->
<div class="container">
<div type="button" id="decline" class="btn btn-danger mrs"></div>
<div class="footer-socials">
</div>
<p class="copyright uppercase center-text no-bottom">Copyright 2014
<br>All rights reserved</p>
</div>
<div style="height:350px"></div>
</div>
</div>
So, as I can see it.. really, the navigation shouldn't be showing at all when the page is loaded, correct? As the navigation is shown when the main page content is slid to the right?
z-index is used to order the layers of divs in HTML. The higher the number, the more 'forward' it will be placed on the page (back to front).
Currently, your <div id="content"> has a z-index of 10, whilst your <div id="sidebar"> has a z-index of 2.
This means your Content div will be placed infront of your Sidebar div, causing the top of the sidebar to be hidden.
Changing these values in your CSS file will change the order.
.page-content is on line 9 of your style.css file
.page-sidebar is on line 25 of your style.css file
i think in line 135 you closed the div wrong
remove closing div from line 135 and place in the end of side bar code at line 162
<div class="nav-item">
Close<em class="unselected-nav"></em>
</div>
</div>
Make the Z-index of your sidebar to 11. Your page content has z-index of 10
<div id="sidebar" style="z-index:11" class="page-sidebar">
I actually resolved this by adjusting <div style="height:350px"></div> to
<div style="height:3350px"></div> worked. The menu now works as expected. Not shown when the page loads, but shown in full when the button is clicked to display it.