Skip to content

Instantly share code, notes, and snippets.

View sudarshanReddykurri's full-sized avatar

SudarshanReddy kurri sudarshanReddykurri

View GitHub Profile
@sudarshanReddykurri
sudarshanReddykurri / index.html
Created September 10, 2016 06:14
Adding Multi line Content using CSS (Method-4)
<div id="test4" data-extra=" of something &#10; food">Hello World</div>
<br>
<div id="test5" data-extra=" of something2 &#xA; food">Hello World</div>
@sudarshanReddykurri
sudarshanReddykurri / index.html
Last active September 10, 2016 06:16
Adding Mutli line Content Using CSS & JS (Method-3)
<div id="test3">Hello World</div>
@sudarshanReddykurri
sudarshanReddykurri / index.html
Created September 10, 2016 06:10
Adding multi-line CSS content (Method-2) Note: The data-extra attribute is multiline
<div id="test2" data-extra=" of bar
food">Hello World</div>
@sudarshanReddykurri
sudarshanReddykurri / index.html
Created September 10, 2016 06:07
Adding multi-line CSS content (Method -1 )
<div id="test1">Hello World</div>
@sudarshanReddykurri
sudarshanReddykurri / scroll.js
Created September 9, 2016 13:36 — forked from rjmccollam/scroll.js
This was written by Chris Coyier of CSS-Tricks (http://css-tricks.com/snippets/jquery/smooth-scrolling/) I have it here for quick access. I also added an offset from the scroll element, sped up the animation, and have it set to only target links in a tag with the class .nav
$(function() {
$('.nav a[href*=#]:not([href=#])').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('html,body').animate({
scrollTop: target.offset().top - 150
}, 400);
return false;
@sudarshanReddykurri
sudarshanReddykurri / index.html
Created September 6, 2016 15:01
Slant Height to the Bottom Background in pure CSS
<div class="slant-left">
<div class="slant-left-inner" style="border-left-width: 1349px;"></div>
</div>
@sudarshanReddykurri
sudarshanReddykurri / index.html
Last active September 6, 2016 15:01
Slant Height to the Top Background in pure CSS
<div class="slant-right">
<div class="slant-right-inner" style="border-right-width: 1349px;"></div>
</div>
@sudarshanReddykurri
sudarshanReddykurri / style.css
Created September 4, 2016 08:40
Center an element in a webpage
#elementid{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
@sudarshanReddykurri
sudarshanReddykurri / insert.php
Created September 1, 2016 07:05
Inserting into mysql database using PDO Prepare Statement
<?php
$database='database';
$email=$_POST['subscribe'];
$host='localhost';
$user='root';
$password='root';
$result=0;
try {
$dbo = new PDO('mysql:host='.$host.';dbname='.$database, $user, $password);
@sudarshanReddykurri
sudarshanReddykurri / index.html
Created August 31, 2016 17:45
Word typing animation in CSS
<p></p>Now i am typing </p>