Problem in fixed layout creation

Asked

Viewed 180 times

3

Guys, I’m having trouble creating a layout fixed that only adapts to the height or width of the screen, whether mobile or desktop. But it is not a responsive site, it is a normal site for desktop, not for the version mobile, but when I open here on my mobile is a few parts outside the layout or below the rodape, I can’t find where I’m going wrong.

This is the site:

http://www.iracemafilha.com.br

I think the problem is in the configuration of the body or div "everything" or even in some div that is passing the screen and so is great and not adapting.

Here’s the site in the repository, if anyone wants to take a look at what’s going on.

https://github.com/isckosta/IracemaFilhaV2.git

  • It’s not because of min-width and min-height?

  • I’ve tried without them using only width: 100%; but still ugly.

  • If you want something beautiful there you want site responsivo yes.

  • No, you don’t understand. There are websites that are not responsive, you open it on mobile and it remains normal, the way it is on the computer screen.

  • On my cell phone it’s just messed up the part about the footer being with min-width: 1353px while the body is with min-width: 768px. If you leave the body with 1353px becomes normal.

  • What top? Which div are you referring to?

  • It’s the body in your CSS

  • Remove the min width of the footer and place on the body?

  • No, keep the two equal with min-width: 1353px

  • What about height? Try to zoom in.

  • Look, it’s better now, but it’s got a white flag under the footer.

  • To solve this of the white space you will have to use http://www.w3schools.com/cssref/css3_pr_mediaquery.asp

  • Try to see the 960gs, it is very good for non responsive site, the desktop version will be the same as the mobile.

Show 8 more comments

2 answers

0

Dude, I got a look at the super fast code, the layout’s a little weird. But it’s easy to solve works with wrapper (100%) set with container-Fixed within each sections with resolution size you want to meet ex: 960px.

The right thing would be to work with relative measures and creating breakpoints with mediaqueries. But the start within what you want is this.

Take a look at the basics so you have an idea: http://codepen.io/carlos-jcdesign/pen/RPyeoZ

0

One strategy you can use in this case is to dynamically fix the height and width of the page so that they are always equal to the height and width of the device’s screen, respectively.

To do this, place the following code inside the block <script type="text/javascript"> in the archive index php.:

var corrigirTamanhoDaPagina = function() {
    // Ajusta a largura da página para ficar igual à largura 
    // da tela do dispositivo (celular, tablet ou pc).
    $("body").css("width", $(document).width() + "px");

    // Ajusta a altura da página para ficar igual à altura da tela do dispositivo.
    $("#div-content").css("height", $(document).height() + "px");
};

// Irá corrigir o tamanho da página assim que ela for carregada.
$(document).ready(function() {
    corrigirTamanhoDaPagina();
});

// Faz com que o tamanho da página seja corrigido sempre que a tela mudar de tamanho, 
// por exemplo quando o celular muda do modo paisagem para retrato e vice versa.
$(window).resize(function() {
    corrigirTamanhoDaPagina(); 
});
  • I agree with the logic, but not with the application (method). Progressive Enhancement always right first! So because be dynamic if I can do the same with css, after all I want to make sure that the content will be delivered accordingly and I can’t play this responsa pro javascript. Finally you would use the same logic as your script only with 2 or at most 3 lines of css breakpoints (media query).

  • @carlosjcdesign yes. In this case this is not really a solution, but a workaround. It works, although it is not the ideal solution. And if the ideal solution is not found, this is still an alternative.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.