If you use a border (cell border) and zero padding between cells, they are still stuck together and you get a double border . To avoid this, you need to specify border-collapse: collapse in the table styles:
...
Dear reader, now you have learned much more about html tag table. Now I advise you to move on to the next lesson.
In the life of every copywriter, there comes a stage of becoming familiar with html tags. Usually this happens spontaneously and looks like a request from the customer to “prepare the text for publication.” This means that in the article you need to highlight headings, paragraphs, significant places and lists, but not with Word capabilities, but with special ones html code language. Tags for a copywriter will help with this. The list required for work is usually small, but it is enough to format text with standard requirements. What is included in the html tags necessary for a copywriter? (If you are too lazy to read, then scroll down - there is a simple and clear thematic infographic about html tags!)
The copywriter asks traditional questions. And they all begin with the wording “what tag is used to specify...”:
- title;
- paragraph;
- thumbnail;
- italics;
- list bulleted/unlabeled/
All this adds spice to the technical task and stimulates the acquisition of new knowledge. The situation gets worse when the task is to use the tag bold text to increase the attractiveness of the key in the PS. But all this can be solved very simply, which we will deal with now.
Tags for creating titles Tags for creating headings are represented by elements h1-h6. They got their letter from the English Header (heading). To set the required type of heading and emphasize its significance for the PS, use following code:
Heading h1 Heading h2 Heading h3 Heading h4 Heading h5 Heading h6
On the website it will look like this.
Heading h1 Heading h2 Heading h3 Heading h4 Heading h5 Heading h6 The h1 heading has the most significance - and visibility -. It is used as the title of a post and is used only once. For subheadings in the text, h2 and h3 are recommended. They help to emphasize the significance of the material under consideration and divide the article into information levels.
Headers h4-h6 are practically not used, but they are in demand for highlighting logical blocks and important fragments.
For large articles it is best to use headings h1-h3, for small ones - h1 and h2.
Lists: bulleted and unlabeled Structured good text always has one or even several lists. In my own way appearance lists are:
marked - they have numbering;
unmarked – elements are highlighted with symbols.
But all Word design is not suitable for publications on the site, so it’s worth learning how to properly format lists in HTML tags.
Tag bulleted list looks like that:
Tag an untagged list like this:
Moreover, each list element has its own HTML frame:
It turns out that in order to highlight a bulleted list in the text using html code, you will need to combine both types of elements used. It will look like this:
List item
List item
List item
List item
For an unmarked list it's similar:
- List item
- List item
- List item
- List item
We've sorted out the lists. We can move on.
Text emphasis tags: bold and italic When figuring out which tag allows you to correctly format the text, you almost immediately come across two code options for each case. This causes confusion among non-programmers and the question: what tag exactly does the customer need.
Everything is very simple! Tags offer physical and logical formatting options. The first are needed for users, the second - for search engines. “Search engines”, seeing the html code suitable for themselves, take into account the selected area and use the information received when ranking, so highlighting text using logical formatting will not be a mistake.
Using html tags makes it possible to please search engines and visually highlight the text for the user. What is more priority, decide for yourself:
Highlighting a phrase in bold for PS and users Highlighting a phrase in bold for users Italicizing phrases for PS and users
Italicize a phrase for users
I have a large and very controversial article on the topic of bold tags, which is called.
If suddenly one of the programmers looks into the topic, then I hasten to note once again that the review is for copywriters: how to put tags, what they are and what is important to consider when choosing. And finally, one more popular html code needed to highlight paragraphs. This
The opening tag is placed before the beginning of the paragraph, and the closing tag is placed at the end. If a paragraph ends with a list, then
is placed after all tags used for the list.
Well, some simple thematic infographics at the end:
When the discussion of the topic began in the comments, in the Club of Successful Copywriters an interesting answer was given to the info-graphics and article Feedback. Here is a screenshot of the opinion of an authoritative participant in the discussion.
Read: 6,687
Hello dear blog readers! In this article you will learn everything about how to insert an image into an html page. Do you have several images that you want to put on your page or do you want to put a logo on your site? All this is easy. After reading this article, you will be able to insert pictures into your html pages without any difficulties. To do this, we will talk in detail about the img tag and its attributes, and briefly consider the formats graphic files, such as gif, jpeg and png, and also look at new HTML5 features that make it easier to insert video and audio into your site.
Due to the fact that graphic data and html text cannot be combined in one file; to display them on the site, a different approach is used than with other elements of html pages. First of all, graphic images, and other multimedia data is stored in separate files. And to implement them into a web page, they use special tags that contain links to these separate files. In particular, such a tag is the img tag. Having encountered such a tag with an address, the browser first requests the corresponding file with an image, audio or video from the Web server, and only then displays it on the Web page.
All graphic images and, in general, any data that is stored in files separate from the web page are called embedded page elements.
Before inserting pictures and looking at the “img” tag in detail, it’s worth learning a little about graphic formats.
Graphic image formats. There are many different graphic formats, but browsers only support a few. Let's look at three of them.
1. JPEG format ( Joint Photographic Experts Group). Quite a popular format used for storing images. Supports 24-bit color and keeps all halftones in photos unchanged. But jpeg does not support transparency and distorts small details and text in images. JPEG is used primarily for storing photographs. Files in this format have the extensions jpg, jpe, jpeg.
2. GIF format ( Graphics Interchange Format). The main advantage of this format is the ability to store several images at once in one file. This allows you to create entire animated videos. Secondly, it supports transparency. The main drawback is that it supports only 256 colors, which is not suitable for storing photos. GIF is mainly used to store logos, banners, images with transparent areas and containing text. Files in this format have the extension gif.
3. PNG format ( Portable Network Graphics). This format was developed as a replacement for the legacy GIF and, to some extent, JPEG. Supports transparency, but does not allow animation. This format has a png extension.
When creating websites, they usually use images in JPEG or GIF format, but sometimes they use PNG. The main thing is to understand in which cases which format is better to use. In short:
Inserting images into html pages So, how do you insert an image onto a web page? A single img tag allows you to insert an image. The browser places the image at the location on the web page where it encounters the img tag.
The code for inserting an image into an html page looks like this:
This html code will place on the web page an image stored in the image.jpg file, which is located in the same folder as the web page. As you may have noticed, the address of the image is indicated in the src attribute. I already told you what it is. So, the src attribute is a required attribute that serves to indicate the address of the file with the image. Without the src attribute, the img tag has no meaning.
Here are a few more examples of specifying the address of a file with an image:
This html code will insert an image on the page called image.jpg, which is stored in the images folder located at the root of the website.
The src attribute can contain more than just relative links to images. Since images are stored online along with html pages, so each image file has its own url. Therefore, you can insert the image url into the src attribute. For example:
This code will insert an image from the site mysite.ru onto the page. A URL is typically used when you are pointing to an image on another site. For images stored on your site, it is better to use relative links.
The img tag is an inline element, so it is better to place it inside a block element, for example inside the “P” tag - paragraph:
Let's practice and paste into our page from previous articles about html image. I will create an “images” folder next to the html file of my page and place a “bmw.jpg” image file there, which looks like this:
Then the html code of the page with the inserted image will be like this:
And look at the display result in the browser:
As we see, there is nothing complicated about placing images on web pages. Next, let's look at a few other important attributes of the "img" tag.
The alt attribute is a fallback option Because image files are stored separately from web pages, the browser has to make separate requests to retrieve them. But what if there are a lot of images on the page and the network connection speed is low, then loading additional files it will take considerable time. And it’s even worse if the image was deleted from the server without your knowledge.
In these cases, the web page itself will load successfully, only white rectangles will be displayed instead of images. Therefore, to tell the user what the image is, . Using this attribute, you specify the so-called replacement text, which will be displayed in an empty rectangle until the image is loaded:
And this is roughly what it looks like:
Set the dimensions of the image There are still a couple of img tag attributes you should know about. This is a pair of width and height attributes. You can use these to specify the image dimensions:
Both attributes specify the size in pixels. The width attribute tells the browser how wide the image should be, and the height attribute how tall it should be. These two attributes can be used together or separately. For example, if you specify only the width attribute, then the browser will automatically select the height in proportion to the specified width and also in the case of using only the height attribute. If you do not specify these attributes at all, the browser will automatically determine the size of the image before displaying it on the screen. It is only worth noting that specifying the image sizes will slightly speed up the browser when displaying the page.
That’s all about inserting images onto pages for now, then we’ll look at how to insert audio or video onto a website...
Insert video and audio from using HTML 5
The new html5 specification introduces several new tags that make it very easy to embed media files. This primarily applies to video and audio.
For inserting audio HTML5 provides paired tag AUDIO. The address of the file in which the audio clip is stored is indicated using the src attribute that is already familiar to us:
The “audio” tag creates a block element on the page. By default, the browser will not play the audio clip. For it to do this, you need to specify a special autoplay attribute in the audio tag. Special because it doesn't matter. The mere presence of this attribute in the tag is enough for it to take effect.
By default, the audio clip is not displayed on the web page. But if you put an attribute in the “audio” tag without the controls value, the browser will display audio playback controls in the place on the web page where the audio tag is placed. They include a play/pause button, a playback bar, and a volume control.
The two main formats used for inserting images into HTML are GIF and JPEG. The GIF format can store simple animation(dynamic banners), JPEG is great for images with big amount flowers, such as photographs. The third format for web graphics is PNG format, but it is not widely used in web design. Any image in GIF or JPEG formats is inserted onto a web page using the tag< img >, there is no closing tag.
SRC attribute The src attribute specifies the address (URL) of the image file, i.e. the browser finds the desired image in the site directory using the path (URL) specified in this attribute. For convenience, all site images are located in a separate folder, usually named image . For example, take any image, preferably a small format, and save it in the created image folder, with the name primer.jpg. Next we will refer to it for training.
Well, let's try to insert a picture on the page? We write the code (path - URL, written depending on the location of the folder with images):
< img src="image/primer.jpg">
Alternative text. ALT attribute Why is alternative text specified? Let's go in order. Every browser has a function to disable images, so a user using this function can see the description specified in the tag alt, which represents the image. This may not be relevant today, since preference is given to unlimited tariffs, but still this is considered a rule of good manners. Let's look at the code example:
You can see this only by turning off the display of images in the browser.
Set the size. WIDTH and HEIGHT attributes Let me note right away that width and height are very important parameters, so you shouldn’t ignore them. Judge for yourself, with unspecified image sizes, and with images disabled in the browser, when images do not load, small empty squares may be located in a completely different place from where you planned to place them. This will not add beauty to the page. Therefore, do not be lazy and always write down the dimensions in the HTML code.
Image sizes are set using tags width- width and height— height, values are set both in pixels and as a percentage of the screen width (with percentages, be very careful). Let's look at the code:
Conclusion Images attract site visitors and carry a lot of visual information, are easy to use, but you still need to follow some recommendations if you want to create a good, popular website.
You should not use too large image file sizes, as this will affect page loading speed. Believe me, this is far from the last indicator.
The ALT attribute has a very important, you must add it for each IMG tag. Content text message must describe the image very accurately, and briefly.
Images on a web page must correspond to the text content.
After studying this section, you can already try yourself as a webmaster and create a full-fledged HTML page. And then let's move on to inserting multimedia.
Did you like the article? Share with your friends:
Facebook
My world
In contact with
Google+
Friends, I use cookies to give you the best experience on my website. If you agree, click "Ok".OK