How we can create a simple and responsive website using HTML, CSS, JS? Solution: See this Simple Responsive Website With Smooth Scrolling, Using CSS & jQuery.
Previously I have shared a one-page portfolio web template, it is also similar but this is a normal website and it has a clean and attractive look with a smooth scroll feature. Small business or individual who wants to represent their business online, they can use this website template. Most of the personal websites are with the same design and layout style, you can check.
Today you will learn to create a clean responsive website using CSS and jQuery. Basically, this template has a full-height gradient background with a logo, title, and texts. At the bottom of the layout, there is an animated scroll down arrow icon or indicator. When you will scroll down, a fixed and sticky navbar will appear at the top. Inside the navbar there are target anchors to navigate sections in the webpage, you will click on any item then you will scroll to that selected section with a smooth scrolling effect.
So, Today I am sharing Simple Responsive Website With Smooth Scrolling. There I have pure HTML and CSS for creating the responsive layout, I did not use any libraries like Bootstrap. And some important features like a smooth scroll, sticky nav, etc are based on jQuery which is a JS library. If you want to create a clean and simple website, then you can use this template.
If you are thinking now how this website actually is, then see the preview given below.
Preview Of Responsive Web Template with CSS and jQuery
See this video preview to getting an idea of how this template looks like.
Now you can see this visually, also you can see it live by pressing the button given above. If you like this then get the source code of its.
You May Also Like:
- JS Frosted Glass Sidemenu
- Bootstrap Responsive Menu Bar
- Content Tab With Smooth Scrolling
- Scrolling Sub Menu Items
Simple Responsive Website With Smooth Scrolling Source Code
Before sharing source code, let’s talk about it. First I have created the layout using HTML tags like section, div, etc. I have created all the sections using HTML <section> tag and placed other properties like div, heading, paragraph, etc tags inside it. And all the icons are based on Font-Awesome library which is linked in the HTML file, other files like CSS, JS, jQuery are linked in the HTML file.
Now using CSS I have placed all the elements in the right place, as you can see in the preview. With CSS first I gave size and position to all the elements, and used CSS @keyframe command to creating the animated scroll down icon. The responsive design is based on CSS @media query, I have reduced and placed the items for 2 or more screen size.
jQuery Handling here the 4 important features of this program. The four features are loop review, target anchor navigation, smooth scroll, and mobile navigation. Most of the functions are based on add and remove the class name method, and it works on click using jQuery .click( function() ) command.
Left all other things you will understand after getting the codes, I can’t explain all in writing. For creating this program you have to create 3 files. First for HTML, second for CSS, and the third file for JavaScript. Follow the steps to creating this without any error.
index.html
Create an HTML file named ‘index.html‘ and put these codes given below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 |
<!DOCTYPE html> <!-- Code By Webdevtrick ( https://webdevtrick.com ) --> <html lang="en" > <head> <meta charset="UTF-8"> <title>Responsive Website Template | Webdevtrick.com</title> <link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/normalize/4.2.0/normalize.min.css'> <link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css'> <link rel="stylesheet" href="./style.css"> </head> <body> <!-- Header Section --> <header id="header"> <div class="main_nav"> <div class="container"> <div class="mobile-toggle"> <span></span> <span></span> <span></span> </div> <nav> <ul> <li><a class="smoothscroll" href="#header">Home</a></li> <li><a class="smoothscroll" href="#about">About</a></li> <li><a class="smoothscroll" href="#skills">Skills</a></li> <li><a class="smoothscroll" href="#portfolio">Portfolio</a></li> <li><a class="smoothscroll" href="#contact">Contact</a></li> </ul> </nav> </div> </div> <div class="title"> <div><i class="fa fa-code" aria-hidden="true"></i></div> <div class="smallsep heading"></div> <h1 class="heading"> Single Page Website</h1> <h2 class="heading">With Achor Smooth Scrolling</h2> <a class="smoothscroll" href="#about"> <div class="mouse"> <div class="wheel"></div> </div> </a> </div> <a class="smoothscroll" href="#about"> <div class="scroll-down"></div> </a> </header> <!-- About Section --> <section id="about"> <div class="container"> <div class="row"> <h1>About</h1> <div class="block"></div> <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p> </div> <div class="row"> <div class="six columns"> <h3><i class="fa fa-cog" aria-hidden="true"></i>Our Process</h3> <p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.</p> </div> <div class="six columns"> <h3><i class="fa fa-pencil-square" aria-hidden="true"></i>Our Approach</h3> <p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.</p> </div> <div class="row"> <div class="six columns"> <h3><i class="fa fa-bullseye" aria-hidden="true"></i>Our Goal</h3> <p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.</p> </div> <div class="six columns"> <h3><i class="fa fa-fighter-jet" aria-hidden="true"></i>Our Mission</h3> <p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.</p> </div> </div> </div> </div> </section> <!-- Team Section --> <section id="team"> <div class="container"> <div class="row"> <h1>Meet the Team</h1> <div class="block"></div> <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p> </div> <div class="row"> <div class="three columns"> <img src="http://placehold.it/220x220" width="220" height="220" alt=""/> <h4>John Doe</h4> <p>Creative Director</p> </div> <div class="three columns"> <img src="http://placehold.it/220x220" width="220" height="220" alt=""/> <h4>Alex Dcruz</h4> <p>Lead Designer</p> </div> <div class="three columns"> <img src="http://placehold.it/220x220" width="220" height="220" alt=""/> <h4>Leren Okas</h4> <p>Designer</p> </div> <div class="three columns"> <img src="http://placehold.it/220x220" width="220" height="220" alt=""/> <h4>Shantanu</h4> <p>Developer</p> </div> </div> </div> </section> <!-- Skills Section --> <section id="skills"> <div class="container"> <h1>Skills</h1> <div class="block"></div> <div class="row"> <div class="one-third column"> <h3>Design</h3> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nostrum, recusandae, at, labore velit eligendi amet nobis repellat natus.</p> </div> <div class="one-third column"> <h3>Development</h3> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nostrum, recusandae, at, labore velit eligendi amet nobis repellat natus.</p> </div> <div class="one-third column"> <h3>Marketing</h3> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nostrum, recusandae, at, labore velit eligendi amet nobis repellat natus.</p> </div> </div> <div class="row"> <div class="eight columns"> <div class="progressBar"> <h4>HTML5</h4> <div class="progressBarContainer"> <div class="progressBarValue value-90"></div> </div> </div> <div class="progressBar"> <h4>CSS3</h4> <div class="progressBarContainer"> <div class="progressBarValue value-80"></div> </div> </div> <div class="progressBar"> <h4>Jquery</h4> <div class="progressBarContainer"> <div class="progressBarValue value-30"></div> </div> </div> <div class="progressBar"> <h4>WordPress</h4> <div class="progressBarContainer"> <div class="progressBarValue value-70"></div> </div> </div> </div> <div class="four columns"> <p>Lorem ipsum dolor sit amet, enim soluta consectetur adipisicing elit. Sit, eius, itaque, porro, beatae impedit officia tenetur reiciendis in quia eum autem. Enim soluta consectetur adipisicing elit.</p> </div> </div> </div> </section> <!-- Portfolio Section --> <section id="portfolio"> <div class="container"> <h1>Portfolio</h1> <div class="block"></div> <div class="row"> <div class="three columns"> <img src="http://placehold.it/220x220?text=Image" class="image" alt="Work One"/></div> <div class="three columns"> <img src="http://placehold.it/220x220?text=Image" class="image" alt="Work Two"/></div> <div class="three columns"> <img src="http://placehold.it/220x220?text=Image" class="image" alt="Work Three"/></div> <div class="three columns"> <img src="http://placehold.it/220x220?text=Image" class="image" alt="Work Four"/></div> </div> <div class="row" style="margin-top: 30px;"> <div class="three columns"> <img src="http://placehold.it/220x220?text=Image" class="image" alt="Work Five"/></div> <div class="three columns"> <img src="http://placehold.it/220x220?text=Image" class="image" alt="Work Six"/></div> <div class="three columns"> <img src="http://placehold.it/220x220?text=Image" class="image" alt="Work Seven"/></div> <div class="three columns"> <img src="http://placehold.it/220x220?text=Image" class="image" alt="Work Eight"/></div> </div> </div> </section> <!-- Testimonials Section --> <section id="testimonial"> <div class="container"> <div class="quoteLoop"> <blockquote class="quote"> <img src="http://placehold.it/100x100?text=First Client" width="100" height="100" alt=""/> <h5> <br> ”Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.”<br> <small>Steve Bruce, Sed ut perspiciatis unde omnis</small></h5> </blockquote> <blockquote class="quote"> <img src="http://placehold.it/100x100?text=Second Client" width="100" height="100" alt=""/> <h5> <br> “Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam.”<br> <small>Tom Jones, Sed ut perspiciatis unde omnis</small></h5> </blockquote> </div> </div> </section> <!-- Contact Section --> <section id="contact"> <div class="container"> <h1>Contact</h1> <div class="block"></div> <form> <div class="row"> <div class="six columns"> <label for="exampleRecipientInput">Name</label> <input class="u-full-width" type="text"> </div> <div class="six columns"> <label for="exampleEmailInput">Email</label> <input class="u-full-width" type="email"> </div> </div> <div class="row"> <label for="exampleMessage">Message</label> <textarea class="u-full-width"></textarea> <input class="button-primary" type="submit" value="Submit"> </div> </form> </div> </section> <!-- Footer Section --> <footer> <div class="container"> <div class="nine columns"> <p>Copyright @ Webdevtrick.com</p> </div> <div class="three columns"> <i class="fa fa-facebook-square" aria-hidden="true"></i> <i class="fa fa-instagram" aria-hidden="true"></i> <i class="fa fa-twitter-square" aria-hidden="true"></i><i class="fa fa-reddit-square" aria-hidden="true"></i> </div> </div> </footer> <!-- partial --> <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js'></script> <script src='https://cdnjs.cloudflare.com/ajax/libs/gsap/1.19.0/TweenMax.min.js'></script> <script src="function.js"></script> </body> </html> |
style.css
Now create a CSS file named ‘style.css‘ and put these codes given here.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 |
/* Code By Webdevtrick ( https://webdevtrick.com ) */ @import url("https://fonts.googleapis.com/css?family=Open+Sans:400,300"); html { font-size: 62.5%; } body { font-size: 1.5em; line-height: 1.6; font-weight: 400; font-family: 'Open Sans', Helvetica, Arial, sans-serif; color: #222; } /* Grid */ .container { position: relative; width: 100%; max-width: 960px; margin: 0 auto; padding: 0 20px; box-sizing: border-box; } .column, .columns { width: 100%; float: left; box-sizing: border-box; } .fa { font-size: 3rem; color: white; letter-spacing: 1rem; } h3 .fa { color: #ff3636; } .title .fa { font-size: 5rem; } /* About */ #about { padding: 100px 0 50px 0; } /* Team */ #team { padding: 50px 0 100px 0; } #team .icon { font-size: 26px; } /* Skills */ #skills { padding: 100px 0 100px 0; background-color: #F5F5F5; } .progressBar { margin-bottom: 26px; margin-bottom: 1.66em; } .progressBar h4 { font-size: 16px; text-transform: none; margin-bottom: 7px; margin-bottom: .33em; } .progressBarContainer { width: 100%; height: 8px; background: #E1E1E1; overflow: hidden; } .progressBarValue { height: 8px; float: left; background: #e55d87; background: -moz-linear-gradient(-45deg, #FF416C 0%, #FF4B2B 100%); background: -webkit-linear-gradient(-45deg, #FF416C 0%, #FF4B2B 100%); background: linear-gradient(135deg, #FF416C 0%, #FF4B2B 100%); } .value-00 { width: 0; } .value-10 { width: 10%; } .value-20 { width: 20%; } .value-30 { width: 30%; } .value-40 { width: 40%; } .value-50 { width: 50%; } .value-60 { width: 60%; } .value-70 { width: 70%; } .value-80 { width: 80%; } .value-90 { width: 90%; } .value-100 { width: 100%; } /* Portfolio */ #portfolio { padding: 100px 0 100px 0; } .image { background-color: #5a5a5a; width: 100%; height: auto; margin-left: auto; margin-right: auto; transition: .5s; } .image:hover { opacity: 0.6; transition: .3s; background-image: url(../images/hoverbg.png); background-repeat: no-repeat; background-position: center; } /* Testimonial */ #testimonial { background-color: #F5F5F5; padding: 100px 0 100px 0; } .quoteLoop { height: auto; width: 100%; margin: 0 auto; position: relative; } .quote { margin: 10px 30px; height: inherit; top: 0px; display: none; text-align: center; } /* Contact Section */ #contact { padding: 100px 0 100px 0; } input[type="email"], input[type="number"], input[type="search"], input[type="text"], input[type="tel"], input[type="url"], input[type="password"], textarea, select { height: 38px; padding: 6px 10px; background-color: #F5F5F5; border: none; box-shadow: none; box-sizing: border-box; border-radius: 0; outline: none; } textarea { min-height: 250px; } input[type="submit"] { display: inline-block; height: 38px; padding: 0 30px; color: #fff; text-align: center; font-size: 11px; font-weight: 600; line-height: 38px; letter-spacing: .1rem; text-transform: uppercase; text-decoration: none; white-space: nowrap; background: #5fc3e4; border-radius: 0px; border: 0; cursor: pointer; box-sizing: border-box; } input[type="submit"]:hover { background: #e55d87; text-decoration: none; } /* Footer */ footer { min-height: 120px; padding: 40px 0 40px 0; background: #e55d87; background: -moz-linear-gradient(-45deg, #FF416C 0%, #FF4B2B 100%); background: -webkit-linear-gradient(-45deg, #FF416C 0%, #FF4B2B 100%); background: linear-gradient(135deg, #FF416C 0%, #FF4B2B 100%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e55d87', endColorstr='#5fc3e4', GradientType=1 ); box-sizing: border-box; } footer p { color: #FFFFFF; margin: 20px 0 0 0; } .socialIcons { font-size: 34px; color: rgba(255, 255, 255, 0.7); } /* Lists */ ul { list-style: circle inside; } ol { list-style: decimal inside; } ol, ul { padding-left: 0; margin-top: 0; } ul ul, ul ol, ol ol, ol ul { margin: 1.5rem 0 1.5rem 3rem; font-size: 90%; } li { margin-bottom: 1rem; } /* Spacing */ button, .button { margin-bottom: 1rem; } input, textarea, select, fieldset { margin-bottom: 1.5rem; } pre, blockquote, dl, figure, table, p, ul, ol, form { margin-bottom: 2.5rem; } /* Utilities */ .u-full-width { width: 100%; box-sizing: border-box; } .u-max-full-width { max-width: 100%; box-sizing: border-box; } .u-pull-right { float: right; } .u-pull-left { float: left; } /* Clearing */ .container:after, .row:after, .u-cf { content: ""; display: table; clear: both; } /* Misc */ .icon { padding-right: 10px; color: #e55d87; } .block { width: 70px; height: 2px; background: #e55d87; background: -moz-linear-gradient(-45deg, #FF416C 0%, #FF4B2B 100%); background: -webkit-linear-gradient(-45deg, #FF416C 0%, #FF4B2B 100%); background: linear-gradient(135deg, #FF416C 0%, #FF4B2B 100%); margin-bottom: 50px; } /* For devices larger than 400px */ @media (min-width: 400px) { .container { width: 85%; padding: 0; } } /* For devices larger than 550px */ @media (min-width: 550px) { .container { width: 80%; } .column, .columns { margin-left: 4%; } .column:first-child, .columns:first-child { margin-left: 0; } .one.column, .one.columns { width: 4.66666666667%; } .two.columns { width: 13.3333333333%; } .three.columns { width: 22%; } .four.columns { width: 30.6666666667%; } .five.columns { width: 39.3333333333%; } .six.columns { width: 48%; } .seven.columns { width: 56.6666666667%; } .eight.columns { width: 65.3333333333%; } .nine.columns { width: 74.0%; } .ten.columns { width: 82.6666666667%; } .eleven.columns { width: 91.3333333333%; } .twelve.columns { width: 100%; margin-left: 0; } .one-third.column { width: 30.6666666667%; } .two-thirds.column { width: 65.3333333333%; } .one-half.column { width: 48%; } /* Offsets */ .offset-by-one.column, .offset-by-one.columns { margin-left: 8.66666666667%; } .offset-by-two.column, .offset-by-two.columns { margin-left: 17.3333333333%; } .offset-by-three.column, .offset-by-three.columns { margin-left: 26%; } .offset-by-four.column, .offset-by-four.columns { margin-left: 34.6666666667%; } .offset-by-five.column, .offset-by-five.columns { margin-left: 43.3333333333%; } .offset-by-six.column, .offset-by-six.columns { margin-left: 52%; } .offset-by-seven.column, .offset-by-seven.columns { margin-left: 60.6666666667%; } .offset-by-eight.column, .offset-by-eight.columns { margin-left: 69.3333333333%; } .offset-by-nine.column, .offset-by-nine.columns { margin-left: 78.0%; } .offset-by-ten.column, .offset-by-ten.columns { margin-left: 86.6666666667%; } .offset-by-eleven.column, .offset-by-eleven.columns { margin-left: 95.3333333333%; } .offset-by-one-third.column, .offset-by-one-third.columns { margin-left: 34.6666666667%; } .offset-by-two-thirds.column, .offset-by-two-thirds.columns { margin-left: 69.3333333333%; } .offset-by-one-half.column, .offset-by-one-half.columns { margin-left: 52%; } } /* Typography ********************************************************************* */ h1, h2, h3, h4, h5, h6 { margin-top: 0; margin-bottom: 2rem; font-weight: 300; } h1 { font-size: 4.0rem; line-height: 1.2; letter-spacing: -.1rem; } h2 { font-size: 3.6rem; line-height: 1.25; letter-spacing: -.1rem; } h3 { font-size: 3.0rem; line-height: 1.3; letter-spacing: -.1rem; } h4 { font-size: 2.4rem; line-height: 1.35; letter-spacing: -.08rem; } h5 { font-size: 1.8rem; line-height: 1.5; letter-spacing: -.05rem; } h6 { font-size: 1.5rem; line-height: 1.6; letter-spacing: 0; } /* Larger than phablet */ @media (min-width: 550px) { h1 { font-size: 5.0rem; } h2 { font-size: 4.2rem; } h3 { font-size: 3.6rem; } h4 { font-size: 3.0rem; } h5 { font-size: 2.4rem; } h6 { font-size: 1.5rem; } } p { margin-top: 0; } /* Links ********************************************************************* */ a { color: #1EAEDB; } a:hover { color: #0FA0CE; } /* Header Section ********************************************************************* */ header { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; display: flex; -webkit-box-pack: center; -webkit-justify-content: center; -ms-flex-pack: center; justify-content: center; width: 100%%; height: 100vh; background: #e55d87; background: -moz-linear-gradient(-45deg, #FF416C 0%, #FF4B2B 100%); background: -webkit-linear-gradient(-45deg, #FF416C 0%, #FF4B2B 100%); background: linear-gradient(135deg, #FF416C 0%, #FF4B2B 100%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e55d87', endColorstr='#5fc3e4', GradientType=1 ); } .title { -webkit-align-self: center; -ms-flex-item-align: center; align-self: center; padding: 2rem; max-width: 960px; text-align: center; } .title .smallsep { background: #fff; height: 2px; width: 70px; margin: auto; margin-top: 30px; margin-bottom: 30px; } .title h1 { font-size: 80px; font-weight: 300; text-transform: uppercase; line-height: 0.85; margin-bottom: 28px; margin: 0; padding: 0; color: #FFFFFF; } .title h2 { color: #FFFFFF; font-size: 16px; font-weight: 400; text-transform: uppercase; letter-spacing: 5px; margin-top: 50px; } @media only screen and (max-height: 700px) { .title h1 { font-size: 80px; } } .title p { max-width: 600px; margin: 0 auto; line-height: 150%; } @media only screen and (max-width: 500px) { .title h1 { font-size: 65px; } } .title .icon { color: #FFFFFF; font-size: 50px; } .main_nav { position: fixed; top: 0px; max-height: 50px; z-index: 999; width: 100%; padding-top: 17px; background: none; overflow: hidden; -webkit-transition: all 0.3s; transition: all 0.3s; opacity: 0; top: -100px; padding-bottom: 6px; } @media only screen and (max-width: 766px) { .main_nav { padding-top: 25px; } } .open-nav { max-height: 400px !important; } .sticky { background-color: #ffffff; opacity: 1; top: 0px; } nav { width: 100%; margin-top: 5px; } @media only screen and (max-width: 766px) { nav { width: 100%; } } nav ul { list-style: none; overflow: hidden; text-align: center; } @media only screen and (max-width: 766px) { nav ul { padding-top: 0px; margin-bottom: 22px; text-align: center; width: 100%; } } nav ul li { display: inline-block; margin-left: 35px; line-height: 1.5; letter-spacing: 1px; } @media only screen and (max-width: 766px) { nav ul li { width: 100%; padding: 7px 0; margin: 0; } nav ul li:first-child { margin-top: 70px; } } nav ul a { text-transform: uppercase; font-size: 12px; text-decoration: none; } nav ul a:hover { color: #CFCFCF; } .mobile-toggle { display: none; cursor: pointer; font-size: 20px; position: absolute; right: 22px; top: 0; width: 30px; } @media only screen and (max-width: 766px) { .mobile-toggle { display: block; } } .mobile-toggle span { width: 30px; height: 4px; margin-bottom: 6px; background: #000000; display: block; } .scroll-down { position: absolute; left: 50%; bottom: 5vh; display: block; text-align: center; font-size: 20px; z-index: 100; text-decoration: none; text-shadow: 0; width: 13px; height: 13px; border-bottom: 2px solid #fff; border-right: 2px solid #fff; z-index: 9; -webkit-transform: translate(-50%, 0%) rotate(45deg); -moz-transform: translate(-50%, 0%) rotate(45deg); transform: translate(-50%, 0%) rotate(45deg); -webkit-animation: fade_move_down 2s ease-in-out infinite; -moz-animation: fade_move_down 2s ease-in-out infinite; animation: fade_move_down 2s ease-in-out infinite; } /* arrow animation */ @-webkit-keyframes fade_move_down { 0% { -webkit-transform:translate(0, -10px) rotate(45deg); opacity: 0; } 50% { opacity: 1; } 100% { -webkit-transform:translate(0, 10px) rotate(45deg); opacity: 0; } } @-moz-keyframes fade_move_down { 0% { -moz-transform:translate(0, -10px) rotate(45deg); opacity: 0; } 50% { opacity: 1; } 100% { -moz-transform:translate(0, 10px) rotate(45deg); opacity: 0; } } @keyframes fade_move_down { 0% { transform:translate(0, -10px) rotate(45deg); opacity: 0; } 50% { opacity: 1; } 100% { transform:translate(0, 10px) rotate(45deg); opacity: 0; } } |
function.js
The last step, create a JavaScript file named ‘function.js‘ and put the codes.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
// Code By Webdevtrick ( https://webdevtrick.com ) // Review Loop function fade($ele) { $ele.fadeIn(1000).delay(3000).fadeOut(1000, function() { var $next = $(this).next('.quote'); fade($next.length > 0 ? $next : $(this).parent().children().first()); }); } fade($('.quoteLoop > .quote').first()); // Navigation $(window).scroll(function() { if ($(window).scrollTop() > 300) { $('.main_nav').addClass('sticky'); } else { $('.main_nav').removeClass('sticky'); } }); // Mobile Navigation $('.mobile-toggle').click(function() { if ($('.main_nav').hasClass('open-nav')) { $('.main_nav').removeClass('open-nav'); } else { $('.main_nav').addClass('open-nav'); } }); $('.main_nav li a').click(function() { if ($('.main_nav').hasClass('open-nav')) { $('.navigation').removeClass('open-nav'); $('.main_nav').removeClass('open-nav'); } }); // Smooth Scrolling jQuery(document).ready(function($) { $('.smoothscroll').on('click',function (e) { e.preventDefault(); var target = this.hash, $target = $(target); $('html, body').stop().animate({ 'scrollTop': $target.offset().top }, 800, 'swing', function () { window.location.hash = target; }); }); }); TweenMax.staggerFrom(".heading", 0.8, {opacity: 0, y: 20, delay: 0.2}, 0.4); |
That’s It. Now you have successfully created Simple Responsive Website With Smooth Scrolling, Using CSS & jQuery. If you have any doubt or question comment down below.
Thanks For Visiting, Keep Visting.
css is not working
What problem are you facing?
Css not working .