Блок контактов html css

How TO — Contact Section

Learn how to create a responsive contact section for web pages.

Contact Section

Create a Contact Section

Step 1) Add HTML:

Example

Contact Us

Swing by for a cup of coffee, or leave us a message:



Step 2) Add CSS:

Example

/* Style inputs */
input[type=text], select, textarea width: 100%;
padding: 12px;
border: 1px solid #ccc;
margin-top: 6px;
margin-bottom: 16px;
resize: vertical;
>

input[type=submit] background-color: #04AA6D;
color: white;
padding: 12px 20px;
border: none;
cursor: pointer;
>

input[type=submit]:hover background-color: #45a049;
>

/* Style the container/contact section */
.container border-radius: 5px;
background-color: #f2f2f2;
padding: 10px;
>

/* Create two columns that float next to eachother */
.column float: left;
width: 50%;
margin-top: 6px;
padding: 20px;
>

/* Clear floats after the columns */
.row:after content: «»;
display: table;
clear: both;
>

/* Responsive layout — when the screen is less than 600px wide, make the two columns stack on top of each other instead of next to each other */
@media screen and (max-width: 600px) .column, input[type=submit] width: 100%;
margin-top: 0;
>
>

Ever heard about W3Schools Spaces? Here you can create your website from scratch or use a template, and host it for free.

Источник

21 CSS Contact Forms

css contact forms

See the Pen Contact Form by Aina Requena (she/her) (@ainarela) on CodePen.

Dev: Aina Requena

Contact Form

Dev: Leena Lavanya

Responsive Contact Form

Dev: Lisa Wagner

Expanding Contact Form

Dev: Joe Harry

Responsive Contact Form

Dev: Bobby Korec

Elegant Contact Form

Dev: Grandvincent Marion

MINIMALISTIC FORM

Dev: Matheus Marsiglio

Contact Form Template

Dev: Chris Holder

RESPONSIVE MATERIAL DESIGN CONTACT FORM

Dev: Nikhil Krishnan

Elegant Contact Form

Dev: Mark Murray

HTML5 Contact Form

Dev: ssbalakumar

Latest Post

55 Cool CSS Calendars

barcodes in css

19 Barcodes in CSS

css masonry layout examples

25 CSS Masonry Layout Examples

css card layouts

23 CSS Card Layouts

css subscribe forms

27 CSS Subscribe Forms

We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it. Ok

Источник

How to create a contact us page in HTML & CSS? (source code)

Contact page html css template

In this post, you’ll see how to create a mobile responsive “Contact Us” page design using HTML & CSS. I will give you all the source code for the template.

Читайте также:  Manage Users

Before you dive in, let’s see the demo of the finished page you will build.

In this template (live preview), I also have two optional parts such as the header navigation & footer. But you can ignore that if you already have them in your existing template.

I commented out both in HTML & CSS files so you can easily understand which code does what specific things.

Let’s start building the contact page together.

Contact page source code

I will give you the HTML & CSS for the contact page template in this section. However, to keep this post concise and short, I will ignore the header & footer parts. But don’t worry if you need them. Because I will also give the link to my GitHub repository so you can download the entire project as you saw in the live demo.

HTML

Contact us
Get in Touch and Let's Build Something Great Together

Welcome to the contact page! I'm excited to hear from you and explore the possibilities of working together. If you have any questions, comments, or ideas, please don't hesitate to reach out. I'm here to help and eager to start a conversation.

Instead of a boring contact form, let's contact directly & using any ways you prefer.

Contact options

Email me (hello@domain.com)

Call me: +1 (234) 567-8900

Contact me on WhatsApp

Lorem ipsum, dolor sit amet consectetur adipisicing elit. Neque fugit vel quae ab beatae blanditiis aspernatur corporis ex nesciunt. Distinctio deserunt consequuntur culpa ea quisquam quibusdam iure enim, dolorum quos. photo

John Doe, Fitness Instructor, California.

Dolor sit amet consectetur adipisicing elit. Neque fugit velquae abbeatae blanditiis aspernatur corporis exnesciunt. Distinctio deserunt consequuntur quibusdam iure enimculpa eaquisquam.
photo

Jane Lave, Therapist, Vancouver, CA.

Consectetur dolor sit amet adipisicing elit. Neque fugit vel quae ab beatae blanditiis aspernatur corporis ex nesciunt. Distinctio deserunt consequuntur culpa ea quisquam quibusdam iure enim, dolorum quos ipsumorem aspernatur blanditiis.
photo

Vladimir Putin, Doctor, California.

star ratingsLorem ipsum, dolor sit amet consectetur adipisicing elit. Neque fugit vel quae ab beatae blanditiis aspernatur corporis ex nesciunt. Distinctio deserunt consequuntur culpa ea quisquam quibusdam iure enim, dolorum quos.
photo

Valeriya, Lawyer, California.

Take your technology to the next level with my expertise The future is technology

Whether you're interested in hiring me for a project, seeking advice, or just want to connect, I'm always happy to hear from you. So go ahead, send me a message and let's build something great together. I look forward to hearing from you!

As you see in the above HTML, I have some images. If you look into the file paths, you’ll see that I have an “img” folder in the project root.

So make sure you also have this “img” folder in your project. Otherwise, update the file paths based on your existing setup.

Читайте также:  Svg in html viewbox

project files & folder structure infographic

See my project files & folder structure in the infographic below:

If you want to get all the demo pictures , please go to this link to download them.

CSS

.contact < background-color: #0a0d12; background-image: url(./img/binding_dark.gif); >@media (min-width: 768px) < .contact .contact-wrapper < max-width: 1100px; margin: 0 auto; >> .contact .contact-wrapper h1 < color: rgba(255, 255, 255, 0.5); text-transform: capitalize; >@media (min-width: 768px) < .contact .contact-wrapper .contact-row < display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-pack: justify; -ms-flex-pack: justify; justify-content: space-between; -webkit-box-align: start; -ms-flex-align: start; align-items: flex-start; >> .contact .contact-wrapper .contact-row .greeting < color: #FFFFFF; margin-bottom: 60px; >@media (min-width: 768px) < .contact .contact-wrapper .contact-row .greeting < -ms-flex-preferred-size: 50%; flex-basis: 50%; >> .contact .contact-wrapper .contact-row .contact-method < background-color: #A6E2FF; padding: 20px 10px; border: 1px solid #5ecbff; border-radius: 4px; >@media (min-width: 768px) < .contact .contact-wrapper .contact-row .contact-method < -ms-flex-preferred-size: 40%; flex-basis: 40%; >> .contact .contact-wrapper .contact-row .contact-method h4, .contact .contact-wrapper .contact-row .contact-method p, .contact .contact-wrapper .contact-row .contact-method a < color: #222222; >.testimonials < background-color: #b2e7fb; padding: 90px 15px; >.testimonials .t_wrapper < max-width: 800px; margin: 0 auto; >.testimonials .t_wrapper .item < background-color: #91defb; padding: 30px; border-radius: 4px; margin: 0 0 30px; >.testimonials .t_wrapper .item img:not(.ratings) < max-width: 100px; display: block; margin: 0 auto; border: 3px solid #5ed1fc; border-radius: 50%; >.testimonials .t_wrapper .item p < text-align: center; >.testimonials .t_wrapper .item blockquote < margin: 0; font-size: 1.125rem; color: #222222; margin: 0 0 15px; >.testimonials .t_wrapper .item blockquote .ratings < display: block; margin: 0 auto 15px; >.testimonials .t_wrapper .item.light < background-color: #c7edfc; >.testimonials .t_wrapper .item.dark < background-color: #9fd3e7; >.testimonials .t_wrapper .item.gradient < background-color: #F73641; background-image: linear-gradient(315deg, #F73641 0%, #58cffc 74%); >@media (min-width: 768px) < .testimonials .t_wrapper .two-col-testimonial < display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-pack: justify; -ms-flex-pack: justify; justify-content: space-between; >.testimonials .t_wrapper .two-col-testimonial .item < -ms-flex-preferred-size: 48%; flex-basis: 48%; >> .cta < background-color: #FFFFFF; padding: 90px 15px; >.cta .container

In the CSS above, I have some media queries to make the page responsive. Mostly, I used Flexbox to create the layouts and align items. If you want to learn more about Flexbox, see this post after.

That’s all! After you save your files, you’ll have a nice & mobile responsive contact page like mine (except for the header & footer).

Download the entire project from GitHub

If you want to get the whole template including the header & footer and as you saw in the demo, please download my entire project from GitHub.

How to download a GitHub repository

If you’re familiar with Git, you can download the entire project directly from your command line (without going to my GitHub account). To do that use the following command: git clone https://github.com/shihabiiuc/contact-page.git

A few words about this template

As you already know that I have created this template using only HTML & CSS. So there is no contact form. To make a working contact form, you need serverside programming such as PHP, Node, Ruby/Rails, etc.

Happy persons jumping infographic

However, the good news is you do not need a contact form on the contact page. The form is not mandatory to have.

Most importantly, contact form data also goes to an email. So why not use directly an email address instead of a boring contact form? A contact form also needs many different validation and it has security vulnerabilities. Moreover, there is a chance to receive a huge number of spam through the form. Although, there are fixes to those problems.

Читайте также:  Python distinct values in list

In a nutshell, having a contact page without a form is totally okay as long as you have an email address there.

Why testimonials are there in the contact page?

Testimonial infographic

As you see in the demo, I have a couple of testimonials on the page. But why?

So the contact page is a kind of money-making page and has a great impact on your online business.

In this context, the testimonials play a vital role. You should put some genuine reviews from your past clients (if you have them). They inspire your future clients & visitors to contact you. And this is why I put the testimonials section on the contact page.

Call to action on the page

call to action infographic

Finally, at the very bottom of the page, I also have a CTA (call to action). Some people need additional pushing and this CTA will do this job (if needed).

It’s not mandatory to have a button or link on every CTA since the visitors are already visiting a contact page. And they can go back to the top and find your email or other contact methods.

Build HTML CSS projects

Conclusion

I built this contact page from scratch and gave you all the code & images you need to build it properly. Additionally, I shared the GitHub repository URL with you. Therefore, if you still have any questions or feedback, please let me know.

If you’re familiar with SCSS(SASS), you can use this file instead of the plain CSS.

Do you need to hire a web developer?

Shihab, headshot

About Shihab

With over 20K monthly readers, my goal is to help small businesses to create a stunning online presence.

At the same time, I’ve been creating resources for web developers, designers & freelancers in general.

Источник

Как сделать — Раздел контакта

Узнать, как создать отзывчивый раздел контактов для веб-страниц.

Раздел контакта

Создать раздел контакта

Шаг 1) Добавить HTML:

Пример

Контакты

Заскочите на чашечку кофе, или оставьте нам сообщение:



Шаг 2) Добавить CSS:

Пример

/* Входные данные стиля */
input[type=text], select, textarea width: 100%;
padding: 12px;
border: 1px solid #ccc;
margin-top: 6px;
margin-bottom: 16px;
resize: vertical;
>

input[type=submit] background-color: #4CAF50;
color: white;
padding: 12px 20px;
border: none;
cursor: pointer;
>

input[type=submit]:hover background-color: #45a049;
>

/* Стиль раздела контейнер/контакт */
.container border-radius: 5px;
background-color: #f2f2f2;
padding: 10px;
>

/* Создайте два столбца, которые плавают рядом друг с другом */
.column float: left;
width: 50%;
margin-top: 6px;
padding: 20px;
>

/* Очистить поплавки после столбцов */
.row:after content: «»;
display: table;
clear: both;
>

/* Адаптивный макет — когда экран меньше 600 пикселей в ширину, сделайте два столбца укладываются друг на друга, а не рядом друг с другом */
@media screen and (max-width: 600px) .column, input[type=submit] width: 100%;
margin-top: 0;
>
>

Источник

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