width

JQuery equally spaced navigation links inside unordered list problem

☆樱花仙子☆ 提交于 2019-12-11 11:06:01
问题 I'm writing a JQuery script which evenly spaces variable-sized horizontal navigation links inside a containing <ul> , using margin-right. The algorithm is: A: Get width of <ul> container. B: Add up widths of all <li> items inside container. C: Calculate right margin for each item except the last <li> by subtracting B from A and dividing by the number of <li> items in the container, minus 1. But there is a flaw either in my algorithm or in my code, because the links are overflowing the

Responsive Set width and height to 80%

孤者浪人 提交于 2019-12-11 10:23:38
问题 I have a problem for set responsive width and height to a container. I need to set height and width of the container in 80% of my screen, but thats not work (i think because body have no height and width). thats an exemple code : <div id="container"> <div class="box"> <div class="element"></div> <div class="element"></div> <div class="element"></div> <div class="element"></div> </div> <div class="box"> <div class="element"></div> <div class="element"></div> <div class="element"></div> <div

Html <td> width issue. Is it related to colspan? How?

好久不见. 提交于 2019-12-11 09:56:00
问题 My <td> width seems to be ignored for some reason related to the tabledatas above it since if I remove all rows except the row that seems to be having the issue, it then works fine. I am thinking it has something to do with the colspans. I saw this answer colspan width issue which talks about how you basically need to imagine there are invisible cells in your table, but I was already doing that, but maybe I am doing it wrong? Here is the html <table border="1" cellspacing="0" cellpadding="0"

find child image width and apply it to containing parent div jquery

我们两清 提交于 2019-12-11 09:48:03
问题 I have an <img> and some <p> 's inside a <div> . I want to get the width of the child img and apply it to the width of the parent div so that the paragraphs of text will wrap to the same width as the img. I want to be able to do this to multiple iterations on the same page. Background: I am developing a wordPress theme that uses the masonry jquery plugin (http://desandro.com/resources/jquery-masonry). My theme has something in common with Gridalicious theme (http://suprb.com/apps/gridalicious

Progress bar width

。_饼干妹妹 提交于 2019-12-11 09:18:34
问题 My code is designed to set the width of my progress bar by calculating the percentage and passing it as a style.width. I am a novice, so apologise for the bad code: JQuery $(document).ready(function() { var width=(1/5*100); $('#progress_bar').css('width','=width + "%"'); }); HTML <div id="progress_bar" style="height:1em; background:red; display:block;"></div> Could someone with a second to spare please help me to get it working and show me where I've gone wrong so I can learn from this? http:

setting width of div jquery

落花浮王杯 提交于 2019-12-11 09:14:21
问题 I'm trying to set the width of a div using jquery. this is how I'm trying to set the size of the div $('#page').css("width",data[0]['imageWidth']); and this is the div I'm trying to set <div id="page"> </div> any help with this would be much appreciated 回答1: In CSS lengths require a unit, in this case most likely Pixel ( px ): $('#page').css("width",data[0]['imageWidth'] + "px"); 来源: https://stackoverflow.com/questions/3881693/setting-width-of-div-jquery

What does 100% really do? (multiple-case study)

ぐ巨炮叔叔 提交于 2019-12-11 08:52:01
问题 I'm currently building a fully responsive website, and the more I try to understand, the more I don't. Principally with percentages. I know a % is based on the first positioned parent. But, I have made some example on JSFiddle, and I had different results: Fiddle In all examples we have the same base: HTML: <div class="example"> <div class="container"> <div class="item"></div> </div> </div> CSS Properties of div s : The .example block has position: relative . It has a width: 60% (of his

Media query div not changing width but everything else works

此生再无相见时 提交于 2019-12-11 07:58:55
问题 I am trying to adjust the width of a div when the browser decreases in size using max-width. The div does everything but change width. I have looked at it through the developer tools on the chrome browser and the width is slashed out. What's wrong? HTML <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <link rel=

Why Doesn't CSS Fixed Positioning Consider the Viewport Only?

£可爱£侵袭症+ 提交于 2019-12-11 07:52:01
问题 It's my understanding that a CSS fixed position element is relative to the viewport only. However, from what I can tell, this is true except that if "left" is unspecified, it doesn't default to 0 but rather to the left edge of what would have otherwise been its container - in this case, the main div. The HTML: <div id="main"> <div id="fixed"></div> <div id="content"></div> </div > The CSS: #main{ width:80%; margin-left:auto; margin-right:auto; } #fixed{ position:fixed; width:100%; height:25px

Page width exceeds the 100% of the screen width

こ雲淡風輕ζ 提交于 2019-12-11 07:45:33
问题 I have a strange problem, I was designing a page and after I finished, found that there is a horizontal scroll bar in the bottom of the page, I checked the page html but found that there is a close tag for each tag. Also I tried to check the widths using jQuery and found that $(window).width() = 1351px and $(document).width() = 1480px any suggestions about what reason for this problem ? 回答1: Using the your web inspector go through and delete interior elements until the scroll bar goes away.