W3.css Modal - Vertical Scroll - modal-dialog

I am using w3.css and am creating a modal div. However, I want lots of text, but I want it to scroll vertically and not scroll at all horizontally.
<!DOCTYPE html>
<html>
<title>W3.CSS</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://www.w3schools.com/lib/w3.css">
<body>
<div class="w3-container">
<h2>W3.CSS Modal</h2>
<button onclick="document.getElementById('id01').style.display='block'" class="w3-btn">Open Modal</button>
<div id="id01" class="w3-modal">
<div class="w3-modal-content" style="overflow-y:scroll;">
<div class="w3-container">
<span onclick="document.getElementById('id01').style.display='none'" class="w3-closebtn">×</span>
<p>Some text. Some text. Some text.</p>
<p>Some text. Some text. Some text.MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM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MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM</p>
</div>
</div>
</div>
</div>
</body>
</html>
How do I ensure the x-scroll bar is not there and the y-scroll bar is and scrolls down the page so all the MMMs appear downwards rather than to the side?

Because you have used continual characters (without spaces) you are going to experience the horizontal line issue.
.w3-modal > .w3-modal-content > .w3-container > p {
word-wrap: break-word;
}
Will fix your issue. the word-wrap property, using the value break-word will do exactly that. Break one very long word up into pieces that fit into the parent elements width.
Though, if you had just used characters with spacing like Lorem Ipsum you wouldn't have had an issue in the first place.
https://jsfiddle.net/showcaseimagery/pzf8p45z/

Related

Simplest responsive grid fail

I am trying to create a responsive grid with a single column containing two adjacent boxes. ⅓ columns on the left and ⅔ columns on the right. Here's the non-responsive version on codepen at http://codepen.io/htmlcheats/pen/OWMobO:
<div class="pure-g">
<div class="pure-u-1-3" style="background-color: red; height: 10em;">
Box 1 - 33.3% width uses pure-1-3 style
</div><!-- .pure-u-1-3 -->
<div class="pure-u-2-3" style="background-color: teal; height: 10em;">
Box 2 - 66.6% width uses pure-2-3 style
</div><!-- .pure-u-2-3 -->
</div><!-- .pure-g -->
It works as expected. When I squish them together or stretch them they remain adjacent.
Here's the responsive version (codepen at http://codepen.io/htmlcheats/pen/OWMobO):
<div class="pure-g">
<div class="pure-sm-md-1-3 pure-u-md-1-3 pure-u-lg-1-3 pure-u-1" style="background-color: red; height: 10em;">
Box 1 - 33.3% width uses pure-1-3 style
</div><!-- .pure-u-1-3 -->
<div class="pure-sm-md-2-3 pure-u-md-2-3 pure-u-lg-2-3 pure-u-1" style="background-color: teal; height: 10em;">
Box 2 - 66.6% width uses pure-2-3 style
</div><!-- .pure-u-2-3 -->
</div><!-- .pure-g -->
When I squash the page they still remain atop each other. If I understand correctly they should collapse and create a single column with the red box standing on top of the teal one.
Can you tell me what I'm doing wrong?.
Your two codepen links in your question (the unresponsive and responsive one) are the same - they both link to the unresponsive version of your example, but I found what I believe was your responsive example.
Anyway, to enable responsive grids in purecss, you have to include the separate responsive grids CSS file as well as the base purecss file. From the responsive grids documentation:
Since media queries cannot be over-written, we do not include the grid system as part of pure.css. You'll have to pull it in as a separate CSS file. You can do this by adding the following tag to your page.
<!--[if lte IE 8]>
<link rel="stylesheet" href="https://unpkg.com/purecss#0.6.2/build/grids-responsive-old-ie-min.css">
<![endif]-->
<!--[if gt IE 8]><!-->
<link rel="stylesheet" href="https://unpkg.com/purecss#0.6.2/build/grids-responsive-min.css">
<!--<![endif]-->
I took the responsive version of your pen and added the links to the responsive CSS files (code block above) and it works as expected. At the end of the day, your CSS links should look like this:
<!-- base purecss file -->
<link rel="stylesheet" href="https://unpkg.com/purecss#0.6.2/build/pure-min.css" integrity="sha384-CCTZv2q9I9m3UOxRLaJneXrrqKwUNOzZ6NGEUMwHtShDJ+nCoiXJCAgi05KfkLGY" crossorigin="anonymous">
<!-- purecss responsive grids -->
<!--[if lte IE 8]>
<link rel="stylesheet" href="https://unpkg.com/purecss#0.6.2/build/grids-responsive-old-ie-min.css">
<![endif]-->
<!--[if gt IE 8]><!-->
<link rel="stylesheet" href="https://unpkg.com/purecss#0.6.2/build/grids-responsive-min.css">
<!--<![endif]-->

Nested JS views

I have the following simple HTML page:
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv='Content-Type' content='text/html;charset=UTF-8'/>
<script src="resources/sap-ui-core.js"
id="sap-ui-bootstrap"
data-sap-ui-libs="sap.ui.commons, sap.ui.table, sap.ui.ux3"
data-sap-ui-theme= "sap_bluecrystal">
</script>
<script>
sap.ui.localResources("zvhr_dashboard");
var view = sap.ui.view({id:"idDashboard1", viewName:"zvhr_dashboard.Dashboard", type:sap.ui.core.mvc.ViewType.JS});
view.placeAt("content");
</script>
</head>
<body class="sapUiBody" role="application">
<header class="header">Page Header</header>
<div id="content" class="content">
<div id="totalHoursChart" class="chartContainer"></div>
<div id="totalCostChart" class="chartContainer"></div>
<div id="totalCountChart" class="chartContainer"></div>
</div>
</body>
The containers totalHoursChart, totalCostsChart, totalCountChart are for line charts. Whenever the template is rendered because of the lines
var view = sap.ui.view({
id:"idDashboard1",
viewName:"zvhr_dashboard.Dashboard",
type:sap.ui.core.mvc.ViewType.JS
});
view.placeAt("content");
There is only one div created in content div and line charts that I draw and place at respective chart containers get overridden. I am unable to figure out how to do this nested views.
I have been unable to find one simple example showing how to do this.
Create a separate div to place your view in:
<div id="content" class="content">
<div id="dashboardContainer"></div>
<div id="totalHoursChart" class="chartContainer"></div>
<div id="totalCostChart" class="chartContainer"></div>
<div id="totalCountChart" class="chartContainer"></div>
</div>
view.placeAt("dashboardContainer");
Well I was able to achieve what I needed and I guess it precisely does fulfill my requirement. I referred to this and understood that the whole page can have a layout and I can place multiple views inside that layout.
The link I provided is of VerticalLayout but there are lot many options to pick from. Using it I was able to place three views(line charts in my case one below the other). The only thing I didnt like was that I had to give fixed width in pixels for every view that I placed inside layout, because when I gave width in percentages the views started shrinking after the page rendering was done.
So to follow the suggestion of #Qualiture I did it in one single div.

Display Hidden Content when JavaScript is Disabled

I have a chunk of content in HTML that is viewable when JavaScript is enabled with fancyBox. The read more link, when clicked, triggers fancyBox to pop up a window that shows the hidden content. The Intro, More and Bob parts are displayed in the fancyBox, but the Intro and Bob parts are displayed first, before the read more linked is clicked. It's a testimonial list, with the read more sections appearing with fancyBox.
...
<li>
<!-- hidden div begin-->
<div id="read-more-1" style="display: none;">
<p>Intro More</p>
<span class="source">Bob</span>
</div>
<!-- hidden div end-->
<!-- displayed begin-->
<p>Intro</p>
<a class="fancy-monials" href="#read-more-1">Read more...</a><br />
<span class="source">Bob</span>
<!-- displayed begin-->
</li>
...
If I disable JavaScript and click the read more link, it just takes me to my home page. Which I expect.
I've flirted with building a <noscript> block that re-displays the testimonials in full, and hides the others but that seems tedious and hacky.
One common way to solve this type of problem is to add a class="no-js" attribute to your page's html element, and then remove this class using javascript.
You can then use this class as a styling hook in your CSS to show/hide content depending on whether JS is enabled. So at the most basic, you might do this (using your code from above):
<html class="no-js">
<head>
<script type="text/javascript">
var dde = document.documentElement;
dde.className = dde.className.replace('no-js','js');
</script>
<style type="text/css">
.no-js .read-more {
display: block;
}
.js .read-more {
display: none;
}
</style>
</head>
<body>
<!-- ... -->
<ul>
<li>
<!-- hidden div begin-->
<div id="read-more-1" class="read-more">
<p>Intro More</p>
<span class="source">Bob</span>
</div>
<!-- hidden div end-->
<!-- displayed begin-->
<p>Intro</p>
<a class="fancy-monials" href="#read-more-1">Read more...</a><br />
<span class="source">Bob</span>
<!-- displayed begin-->
</li>
</ul>
<!-- ... -->
</body>
</html>
In other words, you use javascript to change the no-js class to js, and then use CSS to hide .js .read-more but show .no-js .read-more (or whatever your hidden element's class name may be).
Hope this helps!

scroll bars showing up in iframe, width is only 500px, height set to fluid

I cannot for the life of me figure out why there are scroll bars appearing on my iframe Page tab. The width is set at 500px, after knocking it down 5px at a time from 515px. There are no margins, and the height setting is on "fluid." When I view the html page that the iframe is showing directly, there is no extra white space, so it looks like Facebook is adding white space (a margin or pad?) on the left side of the iframe. The odd thing is that the scroll distance has remained the same as I've narrowed the page down from 515px to 500px. Further, the "fluid" option for the height does not seem to be applying to the iframe, so I can't use the hidden tag in my CSS or half of my content is chopped off.
Is this an issue for anyone else, or am I just doing something wrong? I'll post the code for the page below.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>index_loc3</title>
<link rel="stylesheet" type="text/css" href="loc_styles.css" />
<script language="javascript" src="facebox/jquery.js"></script>
<link rel="stylesheet" type="text/css" href="facebox/facebox.css" />
<script language="javascript" src="facebox/facebox.js"></script>
<script type="text/javascript">
jQuery(document).ready(function($) {
$('a[rel*=facebox]').facebox()
})
</script>
</head>
<body>
<div id="container" style="width:500px">
<div id="header">
<img src="images/logo_slice.jpg" alt="" width="199" height="152" hspace="8" vspace="40" align="left" />
<img src="head_images/ymca1.jpg" align="right">
</div>
<div id="name"><img src="images/text_slice.jpg" alt="YMCA of Greater Fort Wayne" width="485" height="37" hspace="12" />
</div>
<br />
<div id="content1"><img src="images/cent_loc3.jpg" vspace="5">
<img src="images/park_loc3.jpg" alt="Parkview Family Y" vspace="10">
<img src="images/wells_loc2.jpg" alt="Wells County Y" vspace="6">
</div>
<div id="content2"><img src="images/jorg_loc3.jpg" vspace="5">
<img src="images/ren_loc3.jpg" width="240" height="216" vspace="10">
<img src="images/whit_loc3.jpg" vspace="5">
<img src="images/camp_loc3.jpg" vspace="5">
</div>
</div>
</body>
</html>
UPDATE: I found a bit of code that got the iframe to resize properly and get rid of the scroll bars. However, this seems to have caused my Facebox implementation to get messed up. It doesn't appear Facebox recognizes the change in screen position to change the center for Facebox, so it is popping up at the top of the page instead of the current center of the screen.
I had a similar problem where I had vertical and horizontal scrollbars being shown even when they were inactive (in Opera and Firefox, while in IE and Chrome the page was shown without the scrollbars). I had "fluid" height and width selected in the application settings. The problem finally disappeared when I reverted the height setting to "settable" and used the FB.Canvas.setSize function again.
To me it seems that Facebook's "fluid" setting for the height isn't working correctly for all browsers at the moment, maybe try setting it back to settable and going from there.
go to https://developers.facebook.com/apps/YOUR_APP_ID/advanced then
scroll to Canvas Settings then set Canvas Width and Canvas Height as you wish

Browser rendering right margin iPhone/iPad/webkit

I have a html snippet below which renders perfectly in all browsers. However in webkit on an iphone and ipad, when I pinch the page (so that its smaller), I see a black border which is the background color of the body shining through only on the right edge. This only happens when I specifiy the width of the .headerpic div. Since this is the only place in the document I specify the width, I was wondering why it stops short of rendering all the way to the right edge (since this is theoretically the widest part of the document?).
I've attached a photo of what it looks like from my ipad.
<!doctype html>
<html>
<head>
<style>
body {background-color:#000;color:#231f20;margin:0;}
#wrapper {background-color:#fff;min-height:1000px;}
#header .headerpic {height:102px;padding-top:80px;margin:0 auto;width:986px;}
#footer {color:#fff;}
</style>
</head>
<body>
<div id="wrapper">
<div id="header">
<div class="headerpic">
</div>
</div>
</div>
<div id="footer">
</div>
</body>
</html>
In my case using:
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Instead of:
<meta name="viewport" content="width=device-width">
Did the trick!
It will illustrate your problem a little bit clear: http://jsbin.com/ilenu5/5
What I did:
I Increased the width of the
#headerpic to 1286px
I added a
background color of #headerpic,
which is red
So the your actual problem is: overflow occured
Why?
because you don't set your viewport (width=device-width) and the minimum physical width (in px or cm or em) of body, so your body width by default is 980px, and inherited by #wrapper-- so your 986px #headerpic overflows the #wrapper, and makes your black background appear. Since the overflowed area width is small (986-980=6px), you see a black line.
Making #wrapper position:absolute fixes the problem.
In my case this :
<meta name="viewport" content="width=device-width, initial-scale=1.0">
And :
html, body {min-width:980px; overflow-x: hidden;}
Fixes the problem.
Applying
overflow-x:hidden;
to one of my divs did it
Giving credit to #starkadh for the inspiration.