width

Determining the width of a webpage in inches

北城以北 提交于 2019-12-07 02:15:15
问题 I have a CSS stylesheet that uses media queries to change how a page is displayed based on how many inches it is in width (for instance, if it is smaller than 4 inches or being displayed on a handheld device, it assumes a more mobile-friendly LAF). The problem I have is with its content. On the homepage, there is a dock-style interface that dynamically changes height based on the current height and width of the window so that the text and items never leave the screen. However, my JS that

Flexslider Slide Width Issue

一笑奈何 提交于 2019-12-07 01:40:18
问题 I have a strange issue using flexslider. The Slide LIs don't get the correct width so that all slides are shown. This only occurs on first page load. As soon as I switch to another tab and switch back everything looks fine. Maybe a JS Loading Problem?! Screenshot: here flexslider.css .flexslider {margin: 0; padding: 0;} .flexslider .slides > li {text-align: center; display: none; -webkit-backface-visibility: hidden;} /* Hide the slides before the JS is loaded. Avoids image jumping */

Width: 100% Without Scrollbars

99封情书 提交于 2019-12-06 18:19:52
问题 I'm trying to make a part of my webpage that fit the width of the browser, for this I'm using width: 100% , the problem is that it shows scrollbars and I can't use overflow-x: hidden; because it will make some of the content hidden, so how I can fix this? #news { list-style-type: none; position: absolute; bottom: 0; width: 100%; text-align: center; margin-right: 10px; margin-left: 10px; padding: 0; -webkit-user-select: text; } 回答1: Because you're using position: absolute , instead of using:

Is it possible to style a text input to fill the width of it's parent?

我的梦境 提交于 2019-12-06 17:02:36
问题 I have had this issue for years and I've seen similar questions before, but none of them have addressed the fact that when setting width: 100% on an element - paddings, margins and borders will increase the width. Have a look at this Fiddle. The white topmost text box is a standard text box with it's width set to 100% . As you can see it overflows it's parent because of the margin, padding and border settings. The green text box is styled like a div using position: absolute . This works like

IE8 ignores td width, works on IE7

♀尐吖头ヾ 提交于 2019-12-06 16:51:11
问题 There is a table looking like this: <table width="100%"> <tr id="header"> <td colspan="2"></td> </tr> <tr id="center"> <td id="left" style="width: 201px"></td> <td id="mainpage" style="width: 100%"></td> </tr> </table> In every browser (including IE7) apart from IE8 the "left" td is fine. In IE8 it exceeds the width according to the mainpage's content. I'd post some screenshots but it's my first post here. Any ideas whatsoever? 回答1: That width: 100% on the second column doesn't look right -

CSS width in Percent related to the grand parent

心已入冬 提交于 2019-12-06 16:35:05
问题 How to relate width in percent to the grand parent? 回答1: You could simply relate width of li s to the parent ul which in turn it relates to the grand parent div : div{ overflow: hidden; width: 100%; } ul{ width: 1000%; } li{ width: 3%; } 回答2: Use javascript: var g = document.getElementById('grandparent'); var w = g.clientWidth; if (w > 400) w *= .3; var c = document.getElementsByClassName('child'); for (var i=0; i < c.length; i++) { c[i].style.width = w+'px'; } I have a jsfiddle example. 来源:

Set gridview column width programmatically in asp.net

拟墨画扇 提交于 2019-12-06 14:19:52
Need to set the column width of a gridview in asp.net programmatically. ** Autogenerated Columns (i.e., AutogenerateColumns = "true"). I tried the following; protected void gv_RowCreated(object sender, GridViewRowEventArgs e) { e.Row.Cells[2].Width = Unit.Pixel(200); } but no use. This is my GridView1 on aspx file <asp:GridView ID="GridView1" runat="server" AllowSorting="True" Font-Size="Small" Width="800px" OnRowDataBound="GridView1_RowDataBound" > <Columns> <asp:CommandField SelectText="Seç" ShowSelectButton="True"/> </Columns> </asp:GridView> This is where I set my GridView's column width

Facebook Comments Plugin Displays Mobile Width on iPad

和自甴很熟 提交于 2019-12-06 13:48:25
As the title says. Here is the URL if you have an iPad - How can I remove the responsive width of the Comments Plugin for iPads? (bottom of page) http://dev.assessmentday.co.uk/aptitudetests_numerical.htm I ran into this too. I've worked around it by manually adding the data-mobile attribute set to false if I detect this is on an iPad: <script> if (navigator.userAgent.match(/\biPad\b/)) { document.querySelector('div.fb-comments') .setAttribute('data-mobile', 'false'); } </script> This could be improved to handle other tablets as well, but the best way to do that depends on how Facebook auto

Div with a width of 100%, next to a fixed width one

余生长醉 提交于 2019-12-06 13:23:07
Sorry for the incredibly stupid question, I feel like in most circumstances I could do this easily, but I'm using sharepoint at the moment and trying to do anything in this is hell! Basically I have a side navigation (.menu-vertical) that is 230px wide, and a div next to it (.mainContent) that I would like to (padding aside!) fill the rest of the screen. Unfortunately there are around 798 randomly placed divs, spans and whatever else in the code too that I can't seem to strip without breaking the site, so any advice on exactly how to achieve this would be much appreciated, thank you! Basically

Cross-browser method for getting width and height of a DIV?

前提是你 提交于 2019-12-06 12:31:23
This is my first post, so please go easy on me. I'm sure I'm doing everything wrong. However, I couldn't find any posts that answered the question above. I use jQuery. I'm trying to find a way to get the current width and height of a DIV element, even if they're set to "auto". I've found many ways to do this, but no method returns the same width in IE. It is important that this method is cross-browser, as it will break the layout of the page if different numbers are returned in different browsers. .width() and .height() do not work because in IE, padding is subtracted (e.g. width() returns 25