اعلان

صفحة خطأ ):
الصفحة التي تبحث/ي عنها غير موجودة

يمكنك محاولة كتابة كلمة البحث مضبوطه أو الضغط على الزر التالي للعودة للرئيسية

الرئيسية

27‏/2‏/2016

You discuss about: What is the best use of ID or Class in the Css?

which the questions that appear to me in the site statistics through the visitors information on how they arrive at the site some of the phrases people use to search and some formulate a search query by a question. I'll try to answer questions quickly and directly, owner.

What is the best use of ID or Class medals at the site?
The short answer
ID used for only one element in the design can not be for more than one item that gets the same identifier. Kbesmh finger is also a distinctive imprint Everyone one knows it will not be repeated when we give a certain ID to an element on the page, for example, a button or title should not bear the same last identifier element.
Class you can use it and assigned to more than one item on the page. As can be given the same element more than one Class, for example,
?

<h2 class=" arabic feature " id="blogtitle " > ## </h2>
In the previous example of the kind more Class of the same title and two arabic and feature.
Which is better
There is no better a matter of the right to use in the right place. This depends on the design, I, for example, use Class I call button, for example, to determine the form of buttons on the site, and therefore all the buttons will be charged Class = "button" either button, for example, search will carry its own ID because I control it differently may give him class = "button" and I'll give it as well ID = "searchbutton"
What will happen if it did not abide by that?
And why do not adhere to it? It does not seem to me a tough rule, and vice versa when they start working out which would enable them more. But if you want to break it back to you Qaeda political crisis and not a national disaster and has been a lot of browsers the site will not occur.
Knowing that you will not pass the standards test if you do .oon you want to start and design things right form only, do so.
Other benefits

1. When using the ID, for example, if the comments section on your site surrounded by Div with id Id = "comment" and wrote the address in the browser this way
www.bloggertob.tk/#comment
The page will be charged and will move the slider to the comments section directly bar.
2. When using JavaScript in the page using the ID is very important if you want the JavaScript code to target a particular item on the page, the best way to do that is accessed via the ID .olo know I would have given more of the same element identifier Id disaster will occur here :).

ليست هناك تعليقات:

يمنع نشر التعليقات ذات الروابط الدعائية أو تعليقات بإسلوب غير لائق أو التى تحتوى على معلومات شخصية كالبريد الإلكترونى
أعتذر عن الرد على طلبات التوزيع لضيق الوقت أو التبادل الإعلانى

لتصلك إشعارات ردود هذا الموضوع على البريد الإلكترونى أضف علامة بالمربع بجوار كلمة "إعلامى"

جميع الحقوق محفوظة لــ بلوجر توب ©