Первая страница

HTML — Frames

Frames are used to show more than one HTML document in one window. That means you will have a content-less, that will have the role of showing the browser what pages must be displayed. Since PHP and CSS have been introduced, this technique has been used less and less.

HTML — Frames, Credit’s page

Generally, frames are used to display a menu in a part and the content in another part. When someone will click a link from the menu another page will open in the content part.

We will exemplify this using the following code:

  • frameset — the tag that establishes the characteristics of the frames, the individual frames will be defined within it.
  • frameset cols=»#%, *» — «Cols» establishes the height that each frame will have. In the previous example we have established that the first frame (menu) will occupy 30% of the shown area, and we used the » * » sign to indicate the browser that the rest in the rest of the page will be shown the content.
  • frame src=»» — the address of the files that will be displayed as menu and content.
Читайте также:  Java nesting if statements

HTML — Frame — Adding a banner or a title

frameset rows=»#%, *» — «rows» establishes the height of each frame that will be displayed. In the previous example, we have chosen that the first frame will be 20%, and the rest of the space that has remained will be divided between menu.html and content.html

HTML — Frame — Borders and Spaces

You must have noticed that between frames there are some gray lines that most of the time are not wanted. Erasing them is possible using the frameborder and framespacing tags. These attributes will be introduced under the frameset tag.

**Note: Frameset and frameborder is the same attribute. Some browsers do not recognize both of them, just one of them. That being said, our advice is to use both of them for more security.

  • frameborder»#» — The 0 value means there will be no border
  • border=»#» — modifies the border’s thickness (used by Netscape)
  • framespacing=»#» — modifies the border’s thickness (used by Internet Explorer)

Here’s a practical example:

HTML — «Frame name» and «Frame target«

To maintain the menu in its actual position and that when we click on the contact page to open, for example, instead of the content page, we will name every frame and we will specify the place where it will open using the ‘base target’ tag.

Here is our code for the page:

Noresize and scrolling

You can personalize the frame further more using the noresize and scrolling

  • no resize — does not let the frame to change its dimension based on the user’s screen.
  • scrolling=»(yes/no)» — allows, or does not allow, using the scroll in a frame.

Источник

Frame bgcolor in html

Changing the background colour of a frame in HTML can be a daunting task for quite a few developers. While it’s generally not preferred by many people, there might be some specific projects you might have to work on for a client or your employer, which require basic knowledge about changing backgrounds and adding colour to a frame among other similar front-end tasks.

In this article, we shall dive in-depth and try to analyse the process of changing the background colour of a frame in HTML through detailed steps.

What are Frames in HTML?

In HTML, you can add frames which enable you to present multiple HTML documents within the same window. Before starting with the process of changing the background colour of a frame, let’s first create an example frame.

Apart from changing the background colour of a frame in HTML, you should also know what an HTML frame does. HTML frames are used to divide your browser window into multiple sections where each section can load a separate HTML document. A collection of frames in the browser window is known as a frameset.

Frames are achieved by creating a frameset page and defining each frame from within that page. This frameset page doesn’t actually contain any content – just a reference to each frame. The HTML tag is used to specify each frame within the frameset. All frame tags are nested with a tag.

Here is a simple example demonstrating how frames are used:

First, let’s create the left frame for our webpage:

Now, let’s code the right frame of our webpage.

After the individual frames, it’s now time to join those two together in a frameset page.

This is how the frame we created above looks like:

HTML frame example

Now that we know how to create frames, let’s learn how to change and customize the background colours of frames.

Methods to Change Background Colours in HTML

There are usually 2 methods used to change background colours in HTML. Both of them have been described in detail, below –

Method 1: Body Style Method

This is the same method used in the above example. While defining each frame, we can define the tag and specify the background colour, which allows us to change the background colour of a frame in HTML easily.

Method 2: Using Custom CSS

Another good way to change the background colour of a frame in HTML is via using custom CSS code. We can also specify the background colour of frames by defining style tags with CSS.

These are the two methods which we can use to change the background colour of any frame in HTML. Do note that creating multiple frames might hurt the user experience in smaller devices which are unable to load multiple frames.

In case you would like to further know more about using different types of HTML syntax and other associated topics; we highly recommend that you take a look at the Full Stack Development Career Program, launched by Testbook as part of its Testbook Select initiative. You can access study material, online courses, mentoring, and much more for the applicants and prepare for competitive exams through our app. Download the Testbook app on the Play Store today to get great offers and discounts.

The act of developing websites for the internet as a single static page or a complex website having many web pages within it is called Web Development. Web development is a growing area and according to statistics, there are close to a million web development jobs at present with anuual salary of 4.5 LPA. The vacancies and opportunities are countless as well those who seek a well-qualified web developer to fill those roles. Candidates can check out the Topp 5 Best Web Development Books to Learn HTML, CSS, JavaScript, & JQuery.

Источник

Html. Урок #8. Цвета и фреймы

Цвет в HTML задаётся с помощью шестнадцатеричного кода.

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F

Как видите, всего 16 символов: от 0 до F, где 0 представляет наименьшее значение, а F — наибольшее.

Цветовая модель HTML

Любой цвет — это комбинация красного, зелёного и синего света (отсюда RGB, от англ. red, green, blue).

Шестнадцатеричный код цвета состоит из символа решётки (#), за которым следуют три или шесть шестнадцатеричных символов.

Если Вы посмотрите на рисунок, то заметите: там, где круги накладываются, образуются новые цвета:

Цветовые коды

Общее количество всех возможных комбинаций красного, зелёного и синего превышает 16 миллионов.

Вот лишь некоторые из них:

Цвет фона и шрифта

Атрибут bgcolor используется для изменения цвета фона веб-страницы.

В этом примере выйдет темно-синий фон с белым заголовком:

     

Заголовок белым цветом

Веб-страницу можно разделить на фреймы (кадры, окна) с помощью специального документа.

Отдельное окно (фрейм) создаётся с применением тегов , которые заключаются в пару . Каждый тег внутри элемента может содержать различные атрибуты: border (рамка), scrolling (прокрутка), noresize (запрет изменять размер) и т.д.

В элементе назначается количество строк или столбцов фреймов, а также указывается размер каждого из них в процентах или пикселах.

Тег был отменен в языке HTML5.

Работаем с фреймами

Когда необходимо запретить изменение размера фрейма пользователем, используется атрибут :

Содержимое фрейма описывается с помощью атрибута src.

Наконец, элемент даёт возможность просматривать веб-страницу в браузерах, которые не поддерживают фреймы. Внутри этого элемента может находиться альтернативная страница с тегами body и любыми другими элементами.

Источник

Оцените статью