Web-программирование, HTML/CSS

Материал из PTHSWiki
Перейти к: навигация, поиск

Содержание

Какими программами пользоваться

Notepad++
VS Code


Материалы некоторых занятий

21.20.2021

Списки

lists.html

<html>
    <head>
        <title>
            Lists
        </title>
    </head>
    <body>
        <ol>
            <li>List item 1</li>
            <li>List item 2</li>
            <li>List item 3</li>
            <li>List item 4</li>
        </ol>
        <ul>
            <li>unordered list item</li>
            <li>unordered list item</li>
            <li>unordered list item</li>
            <li>unordered list item</li>
            <li>unordered list item</li>
        </ul>
    </body>
</html>

Формы (простой вариант)

forms.html

<html>
    <head>
        <title>Forms</title>
    </head>
    <body>
        <form>
            <input type="text"
           placeholder="Type here..."
           name="just_text">
            <input type="submit" value="Ага, согласен">
        </form>
    </body>
</html>

Формы (вариант посложнее)

forms_extra.html

<html>
    <head>
        <link rel="stylesheet" href="variables.css">
        <title>
            Forms (extra)
        </title>
    </head>
    <body>
        <form>
            <div>
                <p><input name="user_name" type="text" placeholder="User name"></p>
                <p><input name="password" type="password" placeholder="password"></p>
            </div>
            <div>
                Favorite color?
                <input name="color" type="radio" value="white"> White
                <input name="color" type="radio" value="black"> Black
                <input name="color" type="radio" value="red"> Red
                <input name="color" type="radio" value="blue"> Blue
                <input name="color" type="radio" value="green"> Green
            </div>
            <div>
                <input name="ocean" list="oceans" placeholder="Oceans">
                <datalist id="oceans">
                    <option value="Pacific">
                    <option value="Indian">
                    <option value="Atlantic">
                    <option value="Arctic">
                </datalist>
            </div>

            <div>
                <input type="checkbox" id="fav_oceans" name="fav_oceans" checked>
                <label for="pacific">Pacific</label>
            </div>
            <div>
                <input type="checkbox" id="fav_oceans" name="fav_oceans">
                <label for="indian">Indian</label>
            </div>
            </div>
            <div>
                <input type="checkbox" id="fav_oceans" name="fav_oceans">
                <label for="Arctic">Arctic</label>
            </div>
            <div>
                <input type="checkbox" id="fav_oceans" name="fav_oceans" checked>
                <label for="Atlantic">Atlantic</label>
            </div>
        </form>

    </body>
</html>

Стили (inline, type)

styles.html

<html>
    <head>
        <title>Styles</title>
        <style>
            h1, h2 {
                color:red;
                text-align: center;
            }    
        </style>
    </head>
    <body>
        <h1>My first first heading!</h1>
        <h1 style="text-align:right;">Second heading here!</h1>
        <h2>Secret header</h1>
        Hello, world!
    </body>
</html>

Стили (внешний css-файл)

styles_css.html

<html>
    <head>
        <link rel="stylesheet" href="styles.css">
        <title>Styles (CSS)</title>
    </head>
    <body>
        <h1>My first first heading!</h1>
        <h1 style="color:blue; text-align: right">Second heading here!</h1>
        Hello, world!
    </body>
</html>

styles.css

h1 {
    text-align:center;
    color:red;
}
Личные инструменты
Пространства имён
Варианты
Действия
Навигация
Инструменты