Tag » Posts Tagged ‘CSS’

How to disable textarea resizing

If we add a simple textarea in a HTML form then we see that we can resize it by clicking on the bottom right corner of the textarea and dragging the mouse.

<textarea id="txt1" name="txt1" rows="5" cols="50"></textarea>

If we want to stop this resize then you have to just add a simple css as shown below.

textarea {
resize: none;
}

Continue reading »

How to add a JS or CSS file only on Home page in Magento

Magento

In order to optimize the performance of Magento websites it is recommended that you include only the relevant JS Or CSS files on a page. Generally all Magento websites have a slider on home page, so it is good idea to include the slider JS and CSS files only on the home page if none of the other web pages implement a slider.

Continue reading »

How to Add Smooth Page Scroll to Top using jQuery

Scroll to Top

You would have come across websites that provide an easy way to scroll to the top of the webpage as you move down the page, its really a good idea if the webpage is long and you want to provide a better user experience. In this article, we will show you how to add a smooth scroll to top effect using jQuery.

We will create a button on the footer of the page which when clicked will scroll the page to the top smoothly, we will use css to postion the button at a fixed position on the bottom right of the page and jQuery to provide the scrolling effect and make the button visible only if the page is scrolled down, instead of being always visible.

Step 1: Add button link
Place the following code just before the closing </body> HMTL tag

<a href="#" id="scrolltotop" title="Back to top">Back to top</a>

Continue reading »

Magento trying serve CSS files using the system file paths instead of URLs

CSS Merge

We had a separate node for Magento admin and we had to upgrade its hardware. So we prepared a new machine with all the required hosting software and then setup magento code from old box on this machine.

When we visited the Magento admin URL we found that the CSS was not loading. Inspecting the HTML source we found that Magento was trying serve CSS files using the system file paths instead of URLs.

Using Mysql client we verified the Secure/Unsecure base URLs in the` core_config_data` table. We ran the following queries:

SELECT * FROM `core_config_data` WHERE path like 'web/unsecure/%' or path like 'web/secure/%';
SELECT * FROM `core_config_data` WHERE path LIKE 'admin/url%' ;

Continue reading »

Back to top