Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: Automatically resize the page width

  1. #11
    Join Date
    Jun 2011
    Posts
    60
    Thanks
    43
    Thanked 0 Times in 0 Posts

    Default

    Hello,
    It did not work. This code simply specifies the overall text size in the paragraph (Including the main menu). In fact, the problem is that div does not fit into the page.

    Is it possible to specify the div size in pixels, but at the same time it can shrink when the screen shrinks, as is the case with the mobile version?
    Last edited by balki; 05-10-2017 at 09:38 PM.

  2. #12
    Join Date
    May 2014
    Posts
    203
    Thanks
    28
    Thanked 5 Times in 5 Posts

    Default

    you can define it in percentage. not sure about pixels. depends on the rest of the css. if there's something else controlling the size of the div, in percentage, the pixel size will go along for the ride. i don't know the actual rules of css, i just keep tinkering with numbers till it works. sometimes pixels will resize because somewhere in the css, the dimensions in question, are already effected by percentage, in just such a way that the two things (percentage and pixel) can work together. there's also vmin which is specific (but not isolated to) to controlling the views in handheld devices. that's why the other person in the thread linked you to the page on media queries. what they basically do is give you a way to provide different settings for different devices by simply copying and pasting the relevent media queries you're interested in, to the css for the page. similar in concept to building a page for each browser type, etc, yet much simpler.

    the reason i asked about your browser is, google chrome has a developer mode where you can view the site in various devices. i looked at your site in iphone 5 mode and it looked fine to me.

    what i do is find each case where a pixel is listed, and change it to percentage. reload to see result and refine it from there. in some cases, the thing resists percentage and as a result will break the layout (like some javascripts will resist percentage, some css3 also). so always a good idea to save as test page first so you don't ruin your original page.
    Last edited by jundo12; 05-11-2017 at 07:44 AM.

  3. The Following User Says Thank You to jundo12 For This Useful Post:

    balki (05-11-2017)

  4. #13
    Join Date
    Jun 2011
    Posts
    60
    Thanks
    43
    Thanked 0 Times in 0 Posts

    Unhappy

    Thanks for the reply.
    I have a small problem only in the mobile version, when I use the settings as I described them:
    Click image for larger version. 

Name:	Clipboard01.jpg 
Views:	12 
Size:	3.1 KB 
ID:	6173
    Mobile version (The right edge is cut off):
    Click image for larger version. 

Name:	Clipboard012.jpg 
Views:	14 
Size:	7.2 KB 
ID:	6174

    If I decreases the percentages, then the mobile version is accurate, but the full version is shrinking.

Similar Threads

  1. Define Image width & Height automatically
    By boosters in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 04-14-2011, 09:02 AM
  2. Lightbox image viewer 2.03a automatically resize to window?
    By chiba151 in forum Dynamic Drive scripts help
    Replies: 17
    Last Post: 01-08-2011, 01:31 PM
  3. Automatically adjust/resize DIV to fit content
    By wispsofsmoke in forum CSS
    Replies: 0
    Last Post: 11-11-2010, 07:20 PM
  4. Replies: 5
    Last Post: 08-30-2007, 02:33 AM
  5. *Automatically Fitting JPG Width Wise On A Open Window*
    By Anurag Agarwal in forum JavaScript
    Replies: 4
    Last Post: 02-11-2006, 05:51 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •