How to remove gaps between frames - html

How to remove gaps between frames?
There were three frame. I want to clear those gaps.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<style>
* {
margin: 0;
padding: 0
}
</style>
<frameset rows="*,18" cols="*" frameborder="no" border="0" noresize framespacing=0 margin:0;padding:0;border:0;>
<frameset rows="*" cols="343,*" framespacing="0" frameborder="no" border="0">
<frame src="UntitledFrame-2.html" name="leftFrame" scrolling="no" noresize="noresize" id="leftFrame" title="leftFrame" />
<!-- 2是左侧,1是右侧中间,3是下面的黑色。set-1是主文件 -->
<frame src="Untitled-1.html" name="mainFrame" id="mainFrame" title="mainFrame" />
</frameset>
<frame src="UntitledFrame-3.html" name="bottomFrame" scrolling="no" noresize="noresize" id="bottomFrame" title="bottomFrame" />
</frameset>
<noframes>
<body>
<iframe src="http://IP:8090/" frameborder="no" width="100%" height="100%" border="0" marginwidth="0" marginheight="0" scrolling="auto"></iframe>
</body>
</noframes>
</html>

In your frameset, you must add the style attribute propery
So change
<frameset rows="*,18" cols="*" frameborder="no" border="0" noresize framespacing=0 margin:0;padding:0;border:0;>
to
<frameset rows="*,18" cols="*" frameborder="no" border="0" noresize framespacing="0" style="margin:0;padding:0;border:0;">
I also advice you to always close the html attributes with " for example framespacing="0" instead of framespacing=0

Related

frameset not working in IE but works fine Mozilla

Here's the code that works fine in Mozilla but do not works in Internet Explorer. Any idea. Urgency is high.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<FRAMESET rows="15%,81%,4%">
<FRAMESET>
<FRAME src="header.html" frameborder="0" scrolling="no"></FRAME>
</FRAMESET>
<FRAMESET cols="40%,60%">
<FRAME name="login_menu_frame" src="login_box.html" frameborder="0" scrolling="no"></FRAME>
<FRAME name="login_body_frame" src="login_page_body.html" frameborder="0" scrolling="no"></FRAME>
</FRAMESET>
<FRAMESET>
<FRAME name="login_footer_frame" src="footer.html" frameborder="0" scrolling="no"></FRAME>
</FRAMESET>
</FRAMESET>
</html>
Well, I found the answer. The problem lies in the
IE is only recoznising the first . So, whatever is placed after that is not being loaded in the page.
The solution is to put every other frameset in the first [any other frameset] .
The code that worked is:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<FRAMESET rows="15%,81%,4%">
<FRAMESET>
<FRAME src="header.html" frameborder="0" scrolling="no"></FRAME>
<FRAMESET cols="40%,60%">
<FRAME name="login_menu_frame" src="login_box.html" frameborder="0" scrolling="no"></FRAME>
<FRAME name="login_body_frame" src="login_page_body.html" frameborder="0" scrolling="no"></FRAME>
</FRAMESET>
<FRAMESET>
<FRAME name="login_footer_frame" src="footer.html" frameborder="0" scrolling="no"></FRAME>
</FRAMESET>
</FRAMESET>
</FRAMESET>
</head>
</html>
What's up with the CAPS, copy-pasted this from actual -96 sources found on a floppy? ;-P
Also, try and apply consistent indentation for the tags. Your main frameset tag is directly followed by another (rouge) frameset tag, which missing closing tag..
Example usage that clearly indicates which elements are contained inside each other for quick mismatch spotting:
<!DOCTYPE html>
<html>
<head>
<title>HTML Frames</title>
</head>
<frameset rows="10%,80%,10%">
<frame name="top" src="/html/top_frame.htm" />
<frame name="main" src="/html/main_frame.htm" />
<frame name="bottom" src="/html/bottom_frame.htm" />
<noframes>
<body>
<h1>Your browser does not support frames.</h1>
</body>
</noframes>
</frameset>
</html>

Locating Element within the Frameset in Html using selenium Webdriver

I have the following html code
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<frameset id="mainFrameset" bordercolor="#000000" border="2" framespacing="2" frameborder="1" rows="55,*" name="mainFrameset">
<frame scrolling="no" noresize="noresize" marginwidth="0" marginheight="0" src="title.jsp" name="titleFrame">
<frameset id="innerFrameset" framespacing="0" border="0" frameborder="0" cols="20.0%,*" name="innerFrameset">
<frame scrolling="auto" target="mainFrame" noresize="noresize" marginwidth="0" marginheight="0" src="dynamicContents.jsp" name="contentFrame">
<frame scrolling="auto" marginwidth="0" marginheight="0" src="Welcome.jsp" name="mainFrame">
<html>
<head>
<title>retailJava Home</title>
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
</head>
<frameset id="mainFrameset" bordercolor="#000000" border="0" framespacing="0" frameborder="no" rows="*,*">
<frame scrolling="auto" marginwidth="0" marginheight="0" src="WelcomeMain.jsp" name="welcomeMain">
<html>
<head>
<title>Welcome to retail-j</title>
<link type="text/css" href="/rjBackOffice/stylesheets/maintenance.classic.css" rel="stylesheet">
<base target="_self">
</head>
<body text="#000000" leftmargin="0" topmargin="0">
<div id="WelcomeContainer">
<div id="HeaderLogo">
<div id="WelcomeMessages">
<span id="WelcomeMessage">Welcome to retail-j</span>
<span id="LoginInformation">You are currently logged in as BOB</span>
</div>
</div>
</body>
</html>
</frame>
<frame scrolling="auto" marginwidth="0" marginheight="0" src="SystemManagement/InScreenApplicationAlertViewerServlet" name="alertFrame">
<html>
</frame>
</frameset>
<noframes> <body bgcolor="#FFFFFF" text="#000000" topmargin="0" leftmargin="0"> Sorry your browser does not support framesets. </body> </noframes>
</html>
</frame>
</frameset>
<noframes> <body bgcolor="#FFFFFF" text="#000000" topmargin="0" leftmargin="0"> Sorry your browser does not support framesets. </body> </noframes>
</frameset>
</html>
I am trying to locate the the span element with id WelcomeMessage from the above html code. I tried the following to locate
driver.switchTo().frame("welcomeMain");
WebElement element=driver.findElement(By.xpath(".//*[#id='WelcomeMessage']");
Kindly let me know how to switch between framesets/frames [in case of a complex html with convoluted frames as shown above]and locate the elements inside them.
I get the error " unable to locate element welcomeMain......"
Kindly reply to sort this , thanks in advance.
It might be the issue because of your webdriver control may already inside the default frame, and you may need to take the control out of all frame first before taking it to another frame.
Check whether you are able to switch to all the frames available in that page by using below code and this should be working fine.
for (WebElement e :driver.findElements(By.tagName("frame")))
{
driver.switchTo().defaultContent();
driver.switchTo().frame(e);
if(driver.findElement(By.xpath("yourElement")).isDisplayed())
{
driver.findElement(By.xpath("yourElement")).click();
break;
}
else
continue;
}

remove frame scrolling bar

I designed a web page with frames. It is my homework so I must use frames.
In my page there are a lot of frames, and the inner frame has scrolling bar. I ned to remove it, how can i remove it?
This is my main.html code:
<frameset frameborder="NO" framespacing="0" cols="18%,*,18%" border="0" >
<!-- Navigational Bar -->
<frame src="side.html" name="left" marginwidth="5" marginheight="5" frameborder="NO" border="0" noresize="noresize">
<!-- Interior Frame -->
<frameset frameborder="NO" framespacing="0" rows="280,*" border="0">
<frame src="header.html" name="middle" marginwidth="5" marginheight="5" frameborder="NO" border="0" noresize="noresize">
<frameset frameborder="NO" framespacing="0" cols="180,*" border="0">
<frame src="left.html" name="anasayfa" marginwidth="5" marginheight="5" frameborder="NO" border="0" noresize="noresize">
<frame src="anasayfa.html" name="mainframe" marginwidth="5" marginheight="5" frameborder="NO" border="0" noresize="noresize">
</frameset>
</frameset>
<!-- Interior Frame -->
<frame src="side.html" name="right" marginwidth="5" marginheight="5" frameborder="NO" border="0" noresize="noresize">
</frameset>
This is my page outlook:
http://download.cnet.com/YouTube-To-MP3/3000-2071_4-75810474.html >youtube to mp3
Just add to the main.html in lines with frames:
scrolling="no"
so the result is:
<frame scrolling="no" src="left.html" name="anasayfa" marginwidth="5" marginheight="5" frameborder="NO" border="0" noresize="noresize" >
This is your main.html result:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
<meta name="keywords" content="Webpage, design, yumakli" />
<meta name="description" content="Yumakli koyu web sayfasi" />
<style type = "text/css">
frame{
overflow:hidden;
}
</style>
</style>
<script></script>
</head>
<div style="width:5000; height:5000;">
<frameset frameborder="NO" framespacing="0" cols="18%,*,18%" border="0" >
<!-- Navigational Bar -->
<frame src="side.html" name="left" marginwidth="5" marginheight="5" frameborder="NO" border="0" noresize="noresize" scrolling="no">
<!-- Interior Frame -->
<frameset frameborder="NO" framespacing="0" rows="280,*" border="0">
<frame src="header.html" name="middle" marginwidth="5" marginheight="5" frameborder="NO" border="0" noresize="noresize" scrolling="no">
<frameset frameborder="NO" framespacing="0" cols="180,*" border="0">
<frame src="left.html" name="anasayfa" marginwidth="5" marginheight="5" frameborder="NO" border="0" noresize="noresize" scrolling="no">
<frame src="anasayfa.html" name="mainframe" marginwidth="5" marginheight="5" frameborder="NO" border="0" noresize="noresize" scrolling="no">
</frameset>
</frameset>
<!-- Interior Frame -->
<frame src="side.html" name="right" marginwidth="5" marginheight="5" frameborder="NO" border="0" noresize="noresize" scrolling="no">
</frameset>
</div>
</html>
Just set overflow: hidden; on the object:
#objectID {
overflow: hidden;
}
Note: Change objectID for with your object id.
You may also try:
frame{
overflow:hidden;
}
It may work... wouldn't hurt if you try :)
Good luck!
Ok so all you need to do is add: scrolling="no" on each 'frame' tag.
It is as easy as it sounds.
But notice: you would get the full width of the items inside the frame (that's why there is a scroll bar)
Hope i help :)
Add a scrolling attribute to your frame and set the value to no.
http://www.w3schools.com/tags/att_frame_scrolling.asp
Edit:
Another option is to add another frameset around the ones you have currently created.
Found in this question and adapted to you.
file index.html:
<html>
<frameset rows="1,480" frameborder="NO" border="0" noresize="noresize" scrolling="yes">
<FRAME SRC="javascript:<HTML></HTML>" NAME="dummy" FRAMEBORDER="NO" MARGINHEIGHT="0" MARGINWIDTH="0" NORESIZE SCROLLING="NO">
<FRAME SRC="main.html" NAME="scrollcontent" FRAMEBORDER="NO" MARGINHEIGHT="0" MARGINWIDTH="0" NORESIZE SCROLLING="yes">
</frameset>
</html>
file main.html
<html><frameset frameborder="NO" framespacing="0" cols="18%,*,18%" border="0" >
<!-- Navigational Bar -->
<frame src="side.html" name="left" marginwidth="5" marginheight="5" frameborder="NO" border="0" noresize="noresize">
<!-- Interior Frame -->
<frameset frameborder="NO" framespacing="0" rows="280,*" border="0">
<frame src="header.html" name="middle" marginwidth="5" marginheight="5" frameborder="NO" border="0" noresize="noresize" SCROLLING="NO">
<frameset frameborder="NO" framespacing="0" cols="180,*" border="0">
<frame src="left.html" name="anasayfa" marginwidth="5" marginheight="5" frameborder="NO" border="0" noresize="noresize" SCROLLING="NO">
<frame src="anasayfa.html" name="mainframe" marginwidth="5" marginheight="5" frameborder="NO" border="0" noresize="noresize" SCROLLING="NO">
</frameset>
</frameset>
<!-- Interior Frame -->
<frame src="side.html" name="right" marginwidth="5" marginheight="5" frameborder="NO" border="0" noresize="noresize">
</frameset>
</html>
See if that works for you.

Need help resizing this HTML frame

Ok so I've NEVER worked with frames before but a higher power has forced my hand this time.
What I need to be able to do is resize the 'footer.html' frame within this template.
<html>
<head>
<title>Store Title</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<frameset cols="*,1034,*" frameborder="NO" border="0" framespacing="0">
<frame name="sideblanks" scrolling="NO" src="blank_left.html">
<frameset rows="135,*,25" frameborder="NO" border="0" framespacing="0">
<frame name="top" scrolling="NO" noresize src="top_nav.html" >
<frameset cols="200,*" frameborder="NO" border="0" framespacing="0">
<frame name="meny" noresize scrolling="NO" src="menu_1.html">
<frame name="content" src="content.html">
</frameset>
<frame name="chart" scrolling="NO" noresize src="footer.html">
</frameset>
<frame name="sideblanks" scrolling="NO" src="blank_right.html">
</frameset>
<noframes>
<body bgcolor="#FFFFFF" text="#000000">
</body>
</noframes>
</html>
I feel like a complete novice again. I don't like it, I'm scared.
Any help would be great.
Adjust the numeric values here:
<frameset rows="135,*,25" frameborder="NO" border="0" framespacing="0">
you have used "rows" and "columns" you can set the height of the frame with rows or with CSS.
if you need to dynamically alter the height of the frame you might be able to do this with javascript or JQuery but you have to reference it as parent. to make sure you are in the right window.
when are you wanting the height of the frame to change?

How do I create two frames with no space between them?

I'd like to have two frames with no space between them. Here's my test case:
<html>
<frameset framespacing="0" rows="50%, 50%">
<frame frameborder="0" src="red.html" scrolling="no" noresize="1" />
<frame frameborder="0" src="red.html" />
</frameset>
</html>
red.html is just:
<html><body bgcolor="red"></body></html>
When I render this, however, I get a white line between the two frames. How do I make it go away?
You need to specify the FrameBorder property in the Frameset tag.
So, your main page will look like this:
<html>
<frameset framespacing="0" rows="50%, 50%" frameborder="0">
<frame frameborder="0" src="red.html" scrolling="no" noresize="1" />
<frame frameborder="0" src="red.html" />
</frameset>
</html>
This will solve your problem.
<html>
<frameset framespacing="0" rows="50%, 50%" framespacing="0" frameborder=no>
<frame frameborder="0" src="red.html" scrolling="no" noresize="1" />
<frame frameborder="0" src="red.html" />
</frameset>
</html>
frameborder=no is very important.
It is always preferred to use css styles instead of frameborder attribute.
<frameset cols="50%,50%">
<frame src="frame_1.htm" style="border:none">
<frame src="frame_2.htm">
</frameset>
Better to use iframe and divs where ever possible.
Further frameset is not supported in HTML5.
Add border=0 to your frameset tag.
Here is an example of working code that I have used in the past that has no white line.
<frameset rows="10%,*" noresize framespacing=0 frameborder=no border=0 >
<frameset cols="140,*" noresize framespacing=0 frameborder=no border=0 >
<frame name="globe" scrolling="no" src="./GIF/globe.jpg" marginwidth="0 marginheight="0">
<frame name="logo" src="logo.htm" scrolling="no" >
</frameset>
<frameset cols="160,*" noresize framespacing=0 frameborder=no border=0 >
<frame name="userselections" src="userselections.php" scrolling="auto">
<frame name="results" src="nothing.htm" scrolling="auto">
</frameset>
<noframes>
<body>
<p>This page uses frames, but your browser doesn't support them.</p>
</body>
</noframes>
</frameset>