Wordpress - How can I stop a Pardot form on a WPBakery-built page from adding scroll bars on certain browser sizes? - html

So I built this Wordpress page using WPBakery page builder and added a Pardot form to it. On certain browser sizes the form - which looks like it is an iframe element - is larger than the container it's in, so it adds scrollbars to compensate. Is there a recommended solution to keep this from happening? See attached image:
Picture of Pardot form forcing scrollbars

If you're not entirely sure if the form is an iframe element, you could try targeting the form's fields using CSS and using dynamic width and height values such as width: 100%; instead of something like width: 250px;, which will automatically resize your elements to fit the available width. This will take care of the horizontal scrollbar.
For the vertical scrollbar, you could try targeting the scrollbar with psuedo properties to manipulate it's style or hide it altogether. You can read more about it here:
https://css-tricks.com/almanac/properties/s/scrollbar/
It's worth noting though, that this approach isn't highly recommended, due to it's limited support across different browsers and platforms.
However, in the case of this specific vertical scrollbar, it appears to be a height or padding issue on the form's container, so you could target that with #media queries to make it more responsive across devices.
I hope this helps!

The best you can do, is in Pardot, create custom CSS - in Pardot - to accommodate smaller screen sizes.
The biggest issue with this is that the screen size is iframe dependent and not actual browser window width that it's embedded in.
So if you put the iframe into a container that is 600px wide on desktop, that would be a media query of #media (min-width: 600px) in Pardot. You need to adjust the media query for the container size.
If you don't have access to Pardot's CSS tools, you're mostly out of luck.

Related

How do I prevent my web page from being resized smaller than a certain size?

Basically, I don't want the layout and formatting on my page to become nonsensical if the user resizes the browser to a really small size. After a certain limit, the page should not get any smaller as the user resizes the browser to a smaller size. The page should stay the same size and any overflow should be hidden or use scrollbars or whatever. I tried setting min-height on the body but this had no effect at all.
btw, I am already using media queries and they're nice but don't do what my boss wants.
The only think I could think of was to make some sort of element with a fixed size and that would prevent the page from getting smaller than that element.
This is where a media query and CSS will come in handy! (Assuming you already know how to use CSS)
The media query allows you to change the styling of an HTML page based on the size of the screen by using CSS (if you know any CSS).
Use it like so (but place this below all of your CSS code):
#media only screen and (max-width:480px){
//The elements you want to change here
}
As an example, any CSS code you place in this query will apply to your page if the screen width is less than 480 pixels. You could also use min-width, max-height, and min-height for this too.
Example scenario:
div {
width:600px;
height:400px;
}
#media only screen and (max-width:600px){
div {
width:100%;
height:50%;
}
}
In a case like this, if the user is in a browser window or phone with a width of less than 600 pixels, the div will take up half of the screen.
So, instead of trying to prevent things from getting smaller, make them bigger on smaller screens and windows.
There is a more in-depth article here.

Make **ALL** websites in Chrome stretch their content to actually fit the screen width (as in: remove all horizontal space on left/right of ALL pages)

The issue
I'm seeing a lot of websites these days with unused or empty space taking up 1/3 or more of the horizontal width of web pages.
What I'm looking for
I'm trying to figure out if there is a way to remove or decrease the unused horizontal space on webpages. This occurs for many reasons but typically it's due to:
An HTML element that specifies the max-width CSS property.
An HTML element or one of it's classes is referenced in a #media (max-width: <pixel-amount>) query.
Examples
Example 1
The absolute perfect example is https://stackoverflow.com
Here is an image of what I see to be even more clear about the problem:
Example 2
Here is a stackoverflow example where I think it would be very helpful if I could read/see more of the accepted answer without having to scroll up/down constantly. The main content of the page (question/answer section) only takes up 34% of the pages width at 100% zoom in Chrome 92 when I am full screen with a 1920x1080 resolution.
Link to page in this example image
What I've tried
Using the uBlock Origin browser extension I can block elements from appearing on a web page. Depending on how the sites HTML is structured, this occasionally yields the desired effect. It may be possible to block a specific elements CSS property with uBlock Origin (currently trying to figure out).
Possible leads
The content width for many websites such as stackoverflow or stackexchange seems to stop increasing after a specified max-width media query. Or if an HTML element has the max-width CSS property set.
On stackoverflow.com, if I remove the class: body>.container max-width CSS property and do the same for the CSS selector: #content, this resolves the problem on stackoverflow but the changes are reset after reloading the page. I'm assuming solutions for other sites are probably very similar to this or require a change to a class that is referenced in a #media (max-width: <pixel-amount>) query.
You can permanently modify CCS properties of any site using uBlock Origin.
Open uBlock's options and go to filters and add the following to make stackoverflows content not have a max width:
stackoverflow.com##.container:style(max-width: none !important)
stackoverflow.com###content:style(max-width: none !important; width: 100% !important)
Don't forget to hit Apply Changes in uBlock!
You would do the same for other sites except you probably will need to change the site and class/selector
Depending on your browser, the code might be a little different.
The Result

How to size HTML/CSS page so itens does not move when window is resized

I am having a problem with the positioning of elements on my page.
When I try to open the website on an different computer with an different screen size it gets kind of messy.
That same happens when I resize my window. Certain elements stack in each other. Every element is positioned as absolute.
I greatly appreciate any help!
Without seeing you code, it is kind of hard. But I'll try to guess the answer.
You probably have set some width, define the total width of your elements and set that a minimum width of the body. Then when the viewports size is smaller, scrollbars will appear.
Add this to your CSS:
body {
min-width: 800px;
}
Sharing some code would be good.
To handle different screen size you might have to make your site responsive. A responsive layout uses percentages instead of pixels for defining layout element sizes. If you are creating a new page you could try BootStrap http://getbootstrap.com/. Bootstrap will make your layout look the same across different screen sizes.

Positioning in CSS

I 've created a site using Dreamweaver, and all my images have absolute position with % metrics. it expands proportionally on wider screens, but everytime I try to resize and shrink browser window it just becomes a mess with all the images fallen in one narrow window. How can I rebuild my design so it shrinks in a browser window in a way that when it is too small for an element, it just wouldn't fit. Do I have to use fixed pos-ing or any other type of pos-ing? Whats the usual way web designers do the sites?
P.S. my site contains text and abs. images, as well as fixed image that scrolls with the screen. What should I use to keep it that way but make a decent view in all screen sizes?
Use media queries or place a min-width on either the body or the element in question. For example placing min-width:900px on the body will stop the entire body from re-sizing below 900px width. (Note: That is not the responsive way to do things. Media queries are a much better practice)

Elements overlapping eachother on window resize

On this template I've built using Foundation, everything looks correct and responsive except for both navigation bars. They're both on their own <div class="row">, yet they overlap eachother on window resize.
(There is a #media only screen and (max-width: 767px) that is supposed to make it look even cleaner, if it helps at all).
Actually if you open the page on chrome with the developer tools or in firefox with firebug, you can see that when you make the page smaller than 767px width, is when the problems enters, due your #media only screen and (max-width: 767px). i would recommend to check that css cause if you removed it from the html you get a better result, so you may check what attributes inside that css are making your div crazy.
try adding foundation.css (around line 148) .row class height to 140px and moving main-links somewhere inside top of the main-content? That code seriously need either playing around with heights/margin or div blocks imo :)
Edit: roughly editing foundation.css lines is not what you need, make separate css class for that specific height setting and trigger usage of it with correct media query (width which causes problem to occur). That way you can tune any classes you like around the top navigation, its not pretty but it gets things work.
As Jorge Aguilar said, the problem lied in a float: none that was applied to every <li>. Furthermore, I used a width: 100% property to stretch the elements across the entire screen (like it originally was with the floats, but without the overlapping)