How to Select Elements by Attribute in CSS
An attribute selector picks elements by the value of one of their attributes. button[type="submit"] styles the submit button of a form and leaves every other button as it is.
Web Development Technologies and Practices
View All TagsAn attribute selector picks elements by the value of one of their attributes. button[type="submit"] styles the submit button of a form and leaves every other button as it is.
The <style> element holds CSS inside the HTML page itself. Put it in head, write your CSS rules between its tags, and they apply to that page.
The class attribute puts elements into a named group. One CSS rule for . and that name then styles every element in the group, and one element can belong to several groups.
The id attribute gives one element a name that no other element on the page has. CSS can style it with # and that name, scripts can find it by it, and a link ending in # and the name jumps to it.
A <div> is a box with no meaning and no look of its own. Put elements inside it to group them, and you can style the whole group at once, for example with a border, or reach it from a script.
Each <p> element is one paragraph. The browser puts space above and below it, and wraps its text to fit the window, ignoring the line breaks you typed in your code.
Wrap words in <strong> and the browser shows them in bold. Bold is how browsers show what strong means: that the words are important.
A <ul> with one <li> for each item makes a bulleted list: the browser draws a bullet in front of every item and indents the list from the text around it.
An HTML table is a <table> made of rows, <tr>, and each row is made of cells: <th> for a header cell and <td> for a data cell. The browser lines the cells up into columns for you.
<textarea> is a text box for more than one line, for things such as comments, messages and addresses. Pressing Enter in it starts a new line instead of sending the form.