css overflow with elements moved outside div, elements disappear - overflow

I have a form in a div where I brought submit buttons out of the div to another part of the screen. This works nicely. However, I want to lock that div down to a specific size and relative position and use overflow:auto so when it grows too big (the form has elements that are unhidden with checkboxes) the entire screen doesn't scroll, just the div. The problem is, as soon as I add the overflow style, the submit boxes I moved off the div are hidden. I assume this is because with overflow all elements are locked into that div and scroll bars allow you to access them, but in this case the elements are moved left:-500px and it doesn't even give me a scroll bar to scroll left to see them. Basic code follows:
<div class="div1">
<div class="div2">
<form>
<input type="submit" class="sub1" />
</form>
</div>
</div>`
CSS would be:
div.div1 {
position:relative;
width:1000px;
margin: 0 auto;
}
div.div2 {
width:500px;
height:500px;
position:absolute;
top:125px;
left:500px;
}
input[type=submit].sub1 {
position:absolute;
left: -500px;
}
So this works, but as soon as I change the div2 css to:
div.div2 {
width:500px;
height:500px;
position:absolute;
top:125px;
left:500px;
overflow:auto;
}
The submit button disappears.
My question: is there any way to get the scrollbar and keep the div2 container to 500px high without losing the elements outside the div?

If I understand correctly, you can move div2 within the form and leave the submit button outside of div2. That way, the submit button will always be visible and div2 can have overflow.
<div class="div1">
<form>
<div class="div2">
<!-- form fields go here -->
</div>
<input type="submit" class="sub1" />
</form>
</div>
Note: You'll likely need to adjust styles on the button, but I'm not entirely sure about your end goal.

Related

Cannot get radio buttons to align with text correctly in pdf

I have an html fragment that looks like this:
<style>
.r {
display: flex;
}
.d-flex {
display: flex;
align-items: center;
}
</style>
<div class="r">
<input type="radio" disabled="disabled" value="1">
<div class="d-flex">
<span class="answernumber">1) </span>
<div class="answer"><p>One</p></div>
</div>
</div>
When I render this in a browser the radio button, the "1)" and the "One" are all aligned nicely. But when I render this html in a pdf the radio button is not aligned with the text. I have tried multiple alternative style definitions for the classes r, d-flex, answernumber and answer and also for the input[type="radio"] and every time it looks good in a browser, the result is no good in the pdf.
Interestingly, check boxes work just fine. Is there a way to get the html to render in the pdf aligned? Or is this something that needs to be fixed inside iText?
The html inside the div.answer may be much more complex and I have no control over it as it is delivered to me by an external system, so I am limited as to what I can do with the html. What I am in control over, is the style definitions and any configurations to be done to iText (perhaps some ConverterProperties).

Using a background image with an 'H' tag

I followed the answers to try to achieve a similar look to be found here www.thexxcorporation.com
The first header is using a shortcode (its a Wordpress site).
My problem is that the shortcodes don't reflect their actual styling setting, therefore, I'm trying to reproduce the look, but with my own sizes, images etc.
I've tried this:
h1:after
{
background:url(image path);/* apply your image here */
background-repeat:repeat-x;
content:" ";
position:absolute;
width:999em;
height:25px;
margin:10px 0 0 5px;
}
This, almost works, but has a problem. The style relates to headers that are with a content div. My other hears fit within the div fine (100% of the width of the div).
The above code results in the background image overflowing outside the content div it sits within.
So, how do I constrain it to the width of the div it sits within?
My page code looks like this:
<div id="main-content" class="clearfix">
<header id="page-heading">
<div class="boxed">
<h1>Test</h1>
</div><!-- /boxed -->
</header><!-- /page-heading -->
<div id="home-content" class="clearfix boxed container">
<article id="post" class="clearfix">
<div class="entry clearfix fitvids">
<h1>Test page for H1</h1>
</div><!-- .entry .clearfix -->
</article><!-- #post -->
<aside id="sidebar">
</aside><!-- /sidebar --></div><!-- #home-content -->
<div class="clear"></div>
The containing divs are set with position:relative.
If I add position:relative to the h1:after - the background image disappears.
slightly baffled.
Cheers,
Mike
the div it sits within should in relative position. add this style to the div
position:relative;
and the h1::after should have 100 percent width - don't use em. change the width to
width:100%;
hope this helps
cheers

HTML5 AutoFocus attribute causes Firefox to scroll to bottom of page

We have an HTML5 application (<!DOCTYPE html>) with Twitter Bootstrap and various other JavaScript libraries (including jQuery) - all running on their current versions.
The page contains a text input with the autofocus attribute set.
<input type="text" autofocus="autofocus" />
The page contains more than one 'screen' of content, meaning there will always be a vertical scrollbar on the page. The text input is located within the first 'fold' of the page, approx. 250px from the top of the page.
On Chrome, Safari and Opera the page works as expected. When the page loads, the element is on screen and focused.
On FireFox (current version - 18.0.1) the element has focus, but the page has scrolled to 1533px (determined via window.pageYOffset). The same page with differing lengths of content will always scroll to the same position, and the element will be rendered offscreen.
There is definitely only one element with the autofocus attribute set ($("[autofocus]").length).
Removing the autofocus attribute from the element does not cause the page to scroll at all (i.e. the page remains scrolled to the top - as expected).
Can anyone offer any help or insight?
Things we've tried
The following test works correctly:
<!DOCTYPE html>
<html>
<head> </head>
<body>
<div style="height: 200px">
<h1>Test</h1>
</div>
<div style="height: 2000px">
test
<br />
<input autofocus type="text" />
</div>
</body>
</html>
We've recently retried this with Firefox and can't replicate the issue.
Closing...
You need css code to say this:
.focusedInput {
border-color: rgba(82,168,236,.8);
outline: 0;
outline: thin dotted \9;
-moz-box-shadow: 0 0 8px rgba(82,168,236,.6);
box-shadow: 0 0 8px rgba(82,168,236,.6) !important;
}
Then the text input code to be this:
<input class="form-control focusedInput" type="text">

How to get an image to show up over a joomla menu bar

I'm trying to get one div containing an image to show up over a joomla menu-bar... The one I want on top is at the bottom of the code called "wings.gif", but for some reason it won't show up over the user3 joomla bar, which I put in a Div. any ideas how to do this? thanks.
<div style="position:relative; z-index: 2;overflow: visible;"><jdoc:include >type="modules" name="user3" /></div>
<jdoc:include type="modules" name="banner1" style="artstyle" artstyle="art-nostyle" />
<?php echo artxPositions($document, array('top1', 'top2', 'top3'), 'art-block'); ?>
<div class="art-contentLayout">
<div class="art-<?php echo artxCountModules($document, 'right') ? 'content' : 'content->wide'; ?>">
<div style=" position:relative; "> < src="images/stories/image" width="898" height="126" style="position:relative; top: 0; left: 0;"/></div>
<div style=" position: absolute;top:-50px; left:647px; z-index: 1; overflow: visible; ">< src="images/stories/**IMAGE**" width="199" height="136" /></div>
as far as I can see from the code you posted, the absolute div you created is the child of one of the children of the "brother" of your user-3 div :D This means that it floats on top of the last relative positioned item in his parent. But it wont magically fly outside the scope of its parent towards your user-3 div.
Advice: Dont start putting things randomly on relative coz this will make your quest even harder, just make the absolute div a child of your user-3 div, or a "brother".
ps: why is brother quoted? I forgot the name of a same-level node and figured the name was suiting... :D

WatiN SelectList or DIV Click from Google Adwords Keywords Page

I have tried everything but no luck. I am using Watin and C# .NET
What I am doing is going to:
https ://adwords.google.com/o/Targeting/Explorer?__u=1000000000&__c=1000000000&ideaRequestType=KEYWORD_IDEAS#search.none
Note: There's no space between https and ://, but I had to add it because of a markdown problem
Entering the captcha manually (typing the text from Watin).
After you search for keywords, you will see that in the bottom of the page you have a Next and a Previous button.
I would like from WatiN to go to page 2, 3,...
It sounds simple, click on the div (with id gwt-debug-aw-paging-next ) and it will go to next page, but it does not happen.
I tried FireEvent, click, KeyDown, everything ... but it's not working.
I also tried to select 100 results from the Selectlist, but again, it does not work.
I tried it in all ways:
browser.DomContainer.SelectList("gwt-debug-aw-paging-list-box").Option("100").Select();
Nothing seems to work when talking about the buttons from the bottom right of the page.
I managed to "simulate" the click on Broad or Exact results, but not with the bottom buttons.
Any suggestions?
Edit 1:
I uploaded an image so you can see exactly the button I am talking about:
Click here to view it larger.
<div id="gwt-debug-aw-paging-next" class="goog-button-base goog-inline-block goog-button aw-btn aw-pagination-button" tabindex="0" title="Next page">
<input type="text" tabindex="-1" style="opacity: 0; height: 1px; width: 1px; z-index: -1; overflow: hidden; position: absolute;">
<div class="goog-button-base-outer-box goog-inline-block">
<div class="goog-button-base-inner-box goog-inline-block">
<div class="goog-button-base-pos">
<div class="goog-button-base-top-shadow"> </div>
<div class="goog-button-base-content">
<span id="gwt-debug-aw-paging-next-content" class="aw-pagination-next"> </span>
</div>
</div>
</div>
</div>
Please paste the markup of the element you would like to click, including a parent element or two.
This will help in suggesting solutions.
Thanks.
So the following does not work?
using(IE ie = new IE("your-page's-url"))
{
// ... any steps needed to bring up the page in question ...
ie.Element("gwt-debug-aw-paging-next").Click();
}
If not, maybe try clicking on the span gwt-debug-aw-paging-next-content.
I managed to solve the problem. Another programmer gave me this tip, so the credits go to him.
The idea is that there are more spans with the same ID in google adwords (strange, I know), so what we need to do is click on every span, not only at the first span.
Here is the final code that needs to be added:
var pagination = browser.Spans.Where(e =>
e.IdOrName == "gwt-debug-aw-paging-next-content").ToList();
foreach (var item in pagination)
item.Click();

Resources