-
Struggling to understand selectors
Thanks for your reply. I get that but why do they say in the tutorials than an element is worth 1 point, a class is worth so the one with the highest point will override the one with the least points?
-
Struggling to understand selectors
I am really struggling to understand the order of selectors. I have been at this for days, searching the web, reading tutorials and I still cannot find any kind of logical pattern. Please look a code below: <html> <head> <style> p{ color: red; } .my_first_class{ color: green; } .my_first_class .my_second_class { color: yellow; font-size: 45px; } </style> </head> <body> <div class = "my_first_class"> <p> first p tag </p> <h2> the first h2 tag</h2> <div class = "my_second_class"> <p> third p tag </p> <h3> the first h3 tag </h3> </div> </div> </body> </html> Going by what I have read so far I could say a html element is = 1point, a class is = 10 and an id is = 100. So With that in mind the first <p> tag (first p tag) should be in the colour green however it is showing in the browser as red and I don't understand why this is. The p is 1 point whereas the .my_first_class is worth 10 points so that should override the p style which is worth only one point. Can anyone please explain why this isn't overriding in the way that I think it should? I would really appreciate it, thanks.
-
Can px and position: absoloute be used in responsive design?
I'm a litte confused with this. I am currently building a responsive web site and I am also reading a lot on the subject too. I have seen the code for some web sites that are responsive and I can see they have used the px and position absoloute which I was told should not be used when creating a responsive web page. Is that correct?
-
Can media queries be used to remove content?
Rather than using display: none or absolute positioning how else could you remove the content?
-
Can media queries be used to remove content?
If when creating a responsive web page you decided you don't want certain content on smaller screens such as h3 tags or an entire div what is the best way to remove them? Can it be done using media queries as that seems the most obvious solution. Thanks in advance.
-
What is considered when creating a responsive web page?
So would you not bother about any different screen sizes? Would you just concentrate on screen resolution (px)?
-
What is considered when creating a responsive web page?
I am about to start on my project next week but before that I want to make sure I understand the concepts of responsive design before I go ahead. After reading and watching various tutorials I've understood some things but I am not sure on others. Do correct me if I'm wrong but I think when creating a responsive web page two things need to be considered and that is screen resolution and screen size. Would you agree? Let me explain why I think this and you can tell me if I am wrong. Lets say you have two screens both of which are 17inches but the resolutions are different on each, one with high resolution (maximum 1000px) and one with a low resolution (maximum 900px). Then Lets say I create a standard div tag called "header" and I give it a width of 950px. I am sure the high quality monitor of 1000px would display the tag without any problems however I am guessing there would be 50px missing off the tag when displayed on the low resolution monitor of 950px even if we zoomed in or out on the browser. Is that correct? So when creating a responsive web page, to solve this problem, we could set the width say 90% which means no matter what the resolution the page is displayed the div would be in full display with 10% of white space from the right of the div to the browser. Is that correct? Setting the width in % therefore is all well and good however screens also come in different sizes. Lets say you create a web page for two different screens and both had the exact same resolution but one screen was 17inches and other 5inches. The page, I think, would be fine on both screens in that it displays everything however the page will most likely be very small on the 5inch screen as the screen size is smaller. To solve this problem I am guessing you would need to change the layout, design, style, content etc for everything to look right on the smaller screen, is that correct? I think this could prove difficult at times because as far as I no there is no one way to do this or any hard and fast rules. So lets say for example you have two screens one 17inch and another 5inch with exactly the same resolution. Can rules be set in the styles to say if the page is viewed on a 17inch screen use one style sheet but if it's viewed on a screen with 5inches use a different style sheet? Any answers and responses would be much appreciated. I have until the end of this week and the weekend to prepare before I start my website so I am just doing the preparations. Thanks very much.
-
Does the px or resolution change in the browser when the window is resized?
Oh I see. So if you were to remove that particular meta tag from the html code of the example website the browser would not zoom out and it would be distorted. If the resolution of both desktop monitor and th mobile screen were the same in resolution the meta tag would not be required, is that right?
-
Does the px or resolution change in the browser when the window is resized?
Thanks a lot for you responses. This is extremely helpful. So in summary what you are saying is the mobile browser has a meta tag in there that can zoom the web page right out if it's a standard web page with no responsive layout. Is that correct?
-
Does the px or resolution change in the browser when the window is resized?
I can't actually change the meta tag from the browser on my phone. What would happen if I did change it to that out of interest?
-
Does the px or resolution change in the browser when the window is resized?
Sorry. www.cooltoad.com
-
Does the px or resolution change in the browser when the window is resized?
As far as I am aware there is a fundamental difference between pixel (px) and screen size. A 20inch monitor could have the same px as a 5inch mobile phone. I have looked at various websites on both large and small screens and it appears on my mobile phone, on certain sites, everything is visable as it is on a large desktop screen but its really small and zoomed out. When a window is contracted on a desktop monitor I am guessing the px or resolution does not change only the screen size (e.g from 20 inch to 10 inch) changes so why doesn't the web page display as it does on a mobile screen i.e. small and zoomed out? Instead on the desktop monitor when the window is contracted bits of the web page go missing but surely everything should be the same, but only smaller, because the resolution is not changing even though the screen size is. Any help on this would be great.
-
Difference between width in px and %.
I am trying to get to grips with dividers and how their widths work. I have done a lot reading on this so I don't really have a question I just want some clarification if that's ok. Lets say for example a screen size is of 1000px and I create a div of 900px, does this mean there will be white space of 100px from the end of the div to the browser? Going off the same example if I was to centre the div of 900px within the browser/window of 1000px does this mean there will be white space of 50px on either side of the div? Again using the 1000px screen size as the example, if I was to create a div, lets say called "container", and I set the width to 90% does that mean there will be 5% of white space on either side of the div to the browser/window? If I was to contract the window so it would now be say for example 800px does that mean there will still be 5% of white space from either side of the div to the browser/window? I would really appreciate any answers, thanks very much.
-
Setting Height to Auto
Is the height property set to auto by default or if you want it on auto is that something you need to specify? What I mean by that is if you create a div without setting a height value but you start adding text would the height expand as more text goes in? Is that what is meant by "auto" i.e. the div dimension responds to the content within it and changes size?
-
Help with width and height
Is creating a responsive web page without a column system bad design/practise?