HTML/CSS Mobile compatibility

mobile website html code example
mobile css template
css media queries
css detect mobile
css mobile friendly
how to design a website for mobile and desktop
responsive css code for all screen size
css mobile stylesheet

A few days ago I started learning HTML / CSS in my spare time and programming my own test website. At some point I encountered a problem when I tried to visit my website on my smartphone. Here Here you can see that the Picture is shifted above the border.

Everything works fine on the desktop, but as you can see, it has moved on the mobile device. I tried several methods, but none of them resolved the problem. Since I just started, I have no other ideas.

I do not want to post all my code, so the problem is here

thank you in advance

Your problem is not only related to mobile I'm afraid. That is what happens when you float, the container element loses its layout. To fix it you just need to give it back applying for example an overflow: hidden.

But I suppose you want to still have the img on the right of the Personal Data, for that you have to put the image inside the same container, applying the overflow: hidden. Just like this:

/*SCHRIFTART*/

@font-face {
	font-family: 'Levenim MT';
	font-style: normal;
	font-weight: normal;
	src: local('Levenim MT'), url('ufonts.com_levenim-mt.woff') format('woff');
}


/*ALLGEMEIN*/


* {
	margin: 0;
	padding: 0;


}

/* CONTENT */

#PB-Bild {
    float: right;
    margin-top: 6px;
    margin-right:7.5px;
}

#Information {
overflow:hidden;
    height: 30%;
    width: 98%;
    border: 7px outset grey;
    background-color:whitesmoke;
    font-family: 'Arial Rounded MT';
    padding-left: 5px;
    color:darkblue;
}

.was {
    font-size: 150%;
    font-weight:900;
}
p.was::first-letter {
    color:brown;
    font-size:160%;
}

.was {
    font-family:Arial;
    color: black;
}

.uText {
    font-family:Arial;
    background-color:ivory;
    font-size:120%;
}
<div id="Information">
<img id="PB-Bild" src="https://fakeimg.pl/300x350">
    <p class="was">Name:</p>
    Domenic Malz <br>
    <p class="was">Alter:</p>
    16 Jahre <br>
    <p class="was">Geboren am:</p>
    29.04.2002  <br>
    <p class="was">Wohnort:</p>
    Berlin <br>
    <p class="was">E-Mail</p>
    postfach@domenicmalz.de <br>
</div>

Html and css mobile compatible, Try using percentage measurements instead of pixel measurement's. For example: .example {width: 100%}. rather than: .example {width: 700px}. html css mobile fluid. share | improve this question. edited Mar 28 '17 at 14:04. marc_s. 616k 139 139 gold badges 1176 1176 silver badges 1309 1309 bronze badges.

The issue you are bringing is known as responsiveness. There are many ways to make your website responsive, first thing I noticed when looking at your code, in your css you are making use of "px" values, they are pixel values meaning they are not scaling with the size of the screen. You should familiarise yourself with more responsive values such as "vw" and "vh" that do scale according to the size of the screen.

How to Make a Mobile-Friendly Website: Responsive Design in CSS , Make your website mobile-ready, automatically adapting to a mobile phone or computer as needed, using CSS. website's low level code, you will need to know some HTML and CSS. Compatibility with Web Browsers. HTML & CSS Techniques For Cross-Browser Compatibility. Some HTML elements might not be recognized by old browsers; the good part is that these elements are treated as anonymous inline elements i.e. something similar to comments in the source code. Some of the common methodologies to achieve cross-browser portability for HTML are below:

If you add a few properties to #banner2, you can ensure the background does not auto scale.

#banner2 {
  …
  background-size: cover;
  background-position: center;
}

How To Use CSS3 Media Queries To Create a Mobile Version of , device width and height; orientation - for example is a phone in landscape or portrait mode? resolution. If the user has a browser that supports� Roman May 28, 2016. Thank you so much for sharing. this is exactly what i want. unfortunately my skills are pretty basic and i dont know how to set it up always to start collapsed on mobile devices. i mean when i load the page on a device with narrow screen the menu is expanded and the user will not have a look at the content. i want the default initial position collapsed for narrow screens

Make Your HTML-Website Suitable for Mobile Devices : 8 Steps , Responsive (Web)Design is one possible solution. The Good: -Only basic HTML/ CSS knowledge is required -No additional App Programming/Installation As Robert says, plain HTML is compatible with all devices. When we start to add CSS, the layout can start to work against small screens etc. If you are thinking about designing mobile-friendly

Mobile friendly: Tips for website mobile compatibility, Check area widths in the HTML code. Use css to make images responsive. Improve load speed. Decrease the number of images, scripts or videos per page. MOBILE FONTS: Computerlove's Advanced Profile on the iPhone demonstrates how the @font-face technique can be used to bring brand fonts onto a mobile site.

Creating a Mobile-First Responsive Web Design, Responsive web design gives web creators some tools for making layouts that perceived loading time, we're creating two additional HTML documents for our IEMobile)]> in order to serve up enhanced.css to non-mobile to ensure maximum compatibility (there are tools for this) and hoping that one� Make Your HTML-Website Suitable for Mobile Devices: First I was not satisfied when I visited a desktop optimized Website on a smartphone. The fonts are too tiny, you have pan and zoom in/out all the time, the links are always hard to target.

Comments
  • What's the actual question? What are you going to achieve?