support the display. 5px border
In addition, this paper also made a test of height value, the result is the same as border-width, we can also test font-size, Box-shadow and other properties.Http://peunzhang.github.io/demo/d5px/height.htmlImplement the. 5px LineThere are many methods on the network, such as setting up Viewport,box-shawdow,border-image,background-image,transform:scale and so on, here do not introduce (Baidu or google "Retina 1px b
In a mobile Web project, the following 1-pixel border is often implementedMobile Web design, the retina display under the screen will be 1px will be rendered as 2px, then the visual version of 1px lines to restore the page needs CSS defined as 0.5pxBut just as we go to use 0.5px to Boder to find the CSS border-width:0.5px does not work, that is not really support 0.5px it?Some of the problems we found when
:}{ . Border {border:}{ . Border {border :}}1PX Solutions-Border-imageSuch 1 pictures of 6x6, 9 Gongge to fill border-image, so that the element's 4 border width is only 1px@media screen and (-webkit-min-device-pixel-ratio:2) { . border{ Border: 1px solid transparent; Border-image: url (border.gif) 2 repeat; } }Pictures can be used gif, PNG, base64 a variety of formats, above is the upper and lower four border of the wordi
To achieve a solid line of 0.5 pixels on the mobile side, here are the personal practice results1. Through the background-image gradient effect linear-gradient realization:class= "gradient">retina border-bottom 0.5pxp >. Gradient { width: 200px; height: 20px; background-position: Left bottom; background-image:linear-gradient (to Bottom,transparent 50%, #000 50%); Background-repeat: no-re
Basic knowledge of mobile resolution (DPI,DIP calculation)
1. Terminology and concepts
Terms
Description
Note
Screen size (on-screen dimensions)
Refers to the actual physical size of the phone, such as 2.8-inch, 3.2-inch, 3.5-inch, 3.7-i
iphone for the first generationIn 2007, the first iphone was released and the screen was 480 pixels wide. The following are arranged in the order of width and height. This resolution has remained the same for the iphone 3GS.At that time, iOS apps (apps) were written to support absolute targeting only. For example, a button (x, y, width, height) = (20, 30, 40, 50) means its width is 40
Small Program local image processing by screen size, small program screen size
Small Program local image processing by screen size
Preface:
I personally feel that the IDE of small programs is sometimes inconvenient to use. Maybe i
, otherwise users are not good clicks, user experience is very important). At first I didn't think it was a font problem. Later, by constantly debugging, I think the font will have a certain effect, but not sure how much it affects, in this project, I all elements of the width and height are set to a percentage.
Vertical screen and horizontal screen situation, logo display, icon, "Mideo", "hot" and "Friend
Huawei P8 Max
Screen Size: 6.8 inches
Reference Price: 3200 RMB
Recommended reasons: Thin metal body, giant screen
Huawei P8 Max is Huawei recently launched a flagship screen of the high-end giant screen mobile
from loading different folder resources without following screen density, just androidmanifest.xmlAdd the Android:anydensity= "false" field to the file!3) Screen fit problem:Believe that screen adaptation is a headache for everyone, it is said that the nether surface development should pay attention to the place it!① draw the interface when using the Relativelay
the bottom tab bar is 96 pixels, I did it according to Xhdpi".What about the WebThe absolute unit of the mobile page is still px, at least in the code, but it's the same as the app. Because pixel density is an intrinsic property of the device itself, it affects all apps in the device, including the browser. The front-end technology can take advantage of the pixel density of the device, just one line of cod
1. Screen related concepts 1.1 resolutionThe number of pixels on the screen.1.2 screen sizeIt refers to the actual physical size of the mobile phone, such as the commonly used 2.8 inch, 3.2 inch, 3.5 inch, 3.7 inchAndroid divides
, if the size of the DP is 4 common multiple, XHDPI multiplied by the 2,hdpi under the 1.5,ldpi multiplied by 0.75 can satisfy all the dimensions are integer pixel. But assuming a standard of up to 3 dpi, that requires DP to be common multiple, XHDPI multiplied by 1.333,mdpi under 0.666, ldpi divided by 2 The ldpi and XHDPI are more complex, so select the DPI (2) This is explained in Google's official documentation, as the first Android device (HTC's
does not support
If you do not have special requirements, you do not need to define Chinese fonts on the mobile phone end. Use the system default
You can use Helvetica for English and digital fonts.
/* Code for defining fonts on the mobile end */body {font-family: Helvetica ;}2. What is font-size1 and rem?
Rem (font size of the root element) refers to the uni
are not, you can change the above, Defaultpixelratio changed to your device pixel.
Here we fit the text and the size.
Look at the same code on the different phone display effect:
Code:
Export Default classHomeextendsReact.Component{render () { return(View> Textstyle={{fontsize: 30}}> not fit, native pixel: {pixelratio. Get()}Text> Textstyle={{fontsize: Screenutil.setsptext (}}>) has been fitted Text> Viewstyle={{Height: 50,width: 240,BackgroundColo
This article summarizes and explains some solutions and knowledge for mobile H5 HD and multi-screen adaptation. Before the front-end development, visual MM will give us a psd file called the visual draft. For mobile development, in order to achieve the page HD effect, the specifications of visual drafts often follow the following two points :......,.
Background
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.