Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialAdri Johari
17,075 Pointshide scrollbar
I have a question regarding this one problem I have. I have one project right now for front-end web developing and I want to hide scrollbar, someone please help me. Here the HTML code :
<!DOCTYPE HTML>
<html> <head> <title>abc</title> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
</head>
<body>
<div class="typeform-widget" class="invisible-scrollbar" data-url="https://wwforms.typeform.com/to/GDgjO3" style="width: 100%; height: 500px; overflow-y: hidden; border-style: hidden">
</div>
<script>
(function() {
var qs,js,q,s,d=document, gi=d.getElementById, ce=d.createElement, gt=d.getElementsByTagName, id="typef_orm", b="https://embed.typeform.com/";
if(!gi.call(d,id)) { js=ce.call(d,"script");
js.id=id; js.src=b+"embed.js";
q=gt.call(d,"script")[0];
q.parentNode.insertBefore(js,q)
}
})()
</script>
</body>
</html>
1 Answer
Steven Parker
231,264 PointsThis code creates an "iframe" element, which is essentially a window inside your window which opens a different web page.
The scroll bar you are seeing is part of that other web page, which the browser considers a "cross-domain resource". Because of restrictions placed on these kinds of resources, you don't the ability to style it.
Adri Johari
17,075 PointsAdri Johari
17,075 PointsThanks for answering my question. so did you mean there is no solution to my problem?
Steven Parker
231,264 PointsSteven Parker
231,264 PointsYou can't use your web site to change the styling of someone else's. You'd need to look into alternates to what you are doing.
For example, why display someone else's page inside yours? Why not just link directly to the other site (though that won't affect the scroll bar)? Or host the same content on your own site where you can style it?