How to change this script into


Tags: php,html,css

Problem :

Well i found this stream script but the actual design of the area that holds the data is in CSS. But i dont know css so I'm wondering if you could tell me how i could change it to HTML. I dont mean write the code again in HTML.. I mean show me where i can enter my HTML.

All scripts here.

Script with css :

/* grab stuff */
    function get_posts($start = 0, $number_of_posts = 5) {
        /* connect to the db */
        $connection = mysql_connect('localhost','root','');
        mysql_select_db('draft2',$connection);
        $posts = array();
        /* get the posts */
        $query = "SELECT item_id, username, item_content ID FROM wp_posts WHERE post_status = 'publish' ORDER BY post_date DESC LIMIT $start,$number_of_posts";
        $result = mysql_query($query);
        while($row = mysql_fetch_assoc($result)) {
            preg_match("/<p>(.*)<\/p>/",$row['post_content'],$matches);
            $row['post_content'] = strip_tags($matches[1]);
            $posts[] = $row;
        }
        /* return the posts in the JSON format */
        return json_encode($posts);
    }

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"  dir="ltr">
<head>
    <title>Create  a Twitter-Like "Load More" Widget Using CSS, HTML, JSON, and jQuery or MooTools Javascript</title>
    <style type="text/css">
        #posts-container            { width:400px; border:1px solid #ccc; -webkit-border-radius:10px; -moz-border-radius:10px; }
        .post                       { padding:5px 10px 5px 100px; min-height:65px; border-bottom:1px solid #ccc; background:url(dwloadmore.png) 5px 5px no-repeat; cursor:pointer;  }
        .post:hover                 { background-color:lightblue; }
        a.post-title                { font-weight:bold; font-size:12px; text-decoration:none; }
        a.post-title:hover          { text-decoration:underline; color:#900; }
        a.post-more                 { color:#900; }
        p.post-content              { font-size:10px; line-height:17px; padding-bottom:0; }
        #load-more                  { background-color:#eee; color:#999; font-weight:bold; text-align:center; padding:10px 0; cursor:pointer; }
        #load-more:hover            { color:#666; }
        .activate                   { background:url(loadmorespinner.gif) 140px 9px no-repeat #eee; }
    </style>

If you know how to do this will you please tell me :D



Solution :

CSS is just applying styles to html, if you want to add html to the form you should but it in the body tag. (by the way your link to the code is not working)


    CSS Howto..

    How to apply multiple css radial gradients to a single element

    How to vertically align html radio buttons with CSS-only in this code?

    How well does iOS / mobile safari comply with modern browser standards?

    How can I append the images from this JSON file properly into the correct divs

    CSS - How to make a text to be shown under the center of an element, no matter how long the text is

    How can I Add sub menus to dropdown menus?

    float css only menu - how to modify on section2

    CSS: How to make this topheader?

    How do I Align The Border Of Text To An Image? (HTML/CSS) | (Extra [Answered]): How do I Fullscreen with Inspect? |

    How can I use jQuery and/or CSS3 to change how many unordered list items are displayed?

    How to remove the particular CSS style (set through CSS file) from an HTML list

    How to write this 'OR' CSS selector?

    How to make elements stay within container?

    How to remove jquery mobile button color or override button css?

    How to have a sidebar on the right in a responsive page with maximum width?

    How to position two
  • 's within a nested
      ?
  • How to enable real time CSS editing in chrome?

    How to draw arrows in CSS [closed]

    How add “cover”/“shadow” on div?

    How to target Mac with CSS or Javascript

    How to change the colors of HTML form elements displayed in UIWebView?

    How to add a scrollbar to an HTML5 table?

    How do I center all my elements?

    CSS - How to hide extra images

    Inheriting CSS how do I stop it?

    How Would I Center Text In This DIV?

    How to return a javascript set style property to CSS default

    How to set up simple hover buttons with block format?

    How to use environment variables in ReactJS imported CSS?

    How to write multiple css selectors in one line?