I have created an aspx page under Site Pages and when I open it in the browser, it does not have any template attached to it and it just shows a blank page. How to add a masterpaage template to that page, so that I get the same look when I open a custom list.
At the child-page you will be having two content place holders, one for head and other for body. After which you will need to put the needful code in the respective content place holders.
Open the page in SharePoint Designer and add master page reference at the top in code view of the page.