Question:
css web design question?
anonymous
2009-12-27 14:24:42 UTC
css web design question?
Hi

In html is a div used in order to help you call an statement from css


for example if i call my tabs







and the from the css call it

#tabs li {
display:inline;
border-right: 1px solid #999;
}



Is this what the divs are used for?

andd what does this do?

/* Reset */
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td {
padding: 0;
margin: 0;
}
Eight answers:
?
2010-01-03 07:48:58 UTC
Yes, DIVs allow you to apply CSS selectively to parts of a webpage.



The /* Reset */ CSS does what is says on the comment. It sets the padding and margin for all of the named HTML tags to zero, overriding the browsers default values.
Stephen W
2009-12-27 15:50:28 UTC
The elements span and div are used to group and structure documents and will often be used together with the selectors class and id. These two HTML elements are of central importance with regards to CSS. Span is used inline, within a block-level element (for example, to style pieces of text within a pararaph), and div is used to group one or more block-level elements (for example, to style across several paragraphs of text). Just as you've used it really. And the reset is called a global white spave reset to remove padding and margin from all elements to eliminate cross brower non-compliances. Incidentally, the following universal selector will suffice:



* {padding:0;

margin:0;}
anonymous
2016-04-03 05:05:11 UTC
Once you start building Web pages, you will want to learn the languages that build them. HTML is the building block of Web pages. CSS is the language used to make those Web pages pretty. And XML is the markup language for programming the Web. Understanding the basics of HTML and CSS will help you build better Web pages, even if you stick with WYSIWYG editors. And once you're ready, you can expand your knowledge to XML so that you can handle the information that makes all Web pages function. The information on this page will help you learn the languages that make up the Web.
Jim
2009-12-27 14:52:20 UTC
you could have eliminated the div and simply put the id on the ul tag and gotten the same result, but yes, that is what the div is used for.

#tabs refers to the tabs id.

#tabs li makes sure that all li tags within the element with id="tabs" have the formatting outlined within the curly brackets.

here is a class example. classes can be used over and over again instead of just once like id's. classes start with a period (.) and are followed by a class name. look at this example:



ul.greenbullet li {

list-style-type:none;

list-style-image:url(images/greenbullet.gif);

list-style-position:outside;

}

or if you don't like typing, simply

.greenbullet li {

list-style-type:none;

list-style-image:url(images/greenbullet.gif);

list-style-position:outside;

}



  • blah


  • more blah






  1. blah


  2. more blah




the ol only works if you used the latter class definition, ecause the first one nails it down to UL tags only that have the greenbullet class.



body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4… {

padding: 0;

margin: 0;

}

tells that the body tag contents (the body of the document), dl, dt, dd, ul, ol, li, h1, h2, h4, h4 will be flush left with the browser window, no padding. Your lists will look really flat. as for the li tag, whichever declarations come last have the highest priority and will be chosen first.
frazz007
2009-12-27 14:37:44 UTC
div tags are used to slice up a webpage like the good old html table tags

like all tags you can change preferences in the css font size color etc
Markus
2009-12-27 14:29:09 UTC
divs are sort of like the new ways of making tables, and yes they can take information from the css using the id tag





and what does that do?



it defines all those tags
anonymous
2009-12-27 14:30:36 UTC
do this:













and the from the css call it



li tabs{

display:inline;

border-right: 1px solid #999;

}
harrybapty
2009-12-27 14:28:26 UTC
no divs are used to divide pages into sections called blocks, that is why css is called the block method.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...