A method for viewing web pages, applied to an electronic device comprising a style-template database, wherein the style-template database records a plurality of classifications, a pattern of each of the plurality of classifications, a DOM (Document Object Model) of each of the plurality of classifications, and at least one browsing setting of each of the plurality of classifications, the method comprising the steps of: (a) obtaining a web page; (b) analyzing the web page to determine a specific classification of the web page according to a URL (Uniform Resource Locator) and contents of the web page; the step (b) comprises the steps of: comparing the URL of the web page with the pattern of each of the plurality of classifications so as to obtain one or more first candidate classifications matching the URL; and performing a similarity analysis to compare the URL of the web page with the pattern of each of the one or more first candidate classifications so as to obtain a first similarity; and the step (b) further comprises the steps of: obtaining a DOM tree of the web page; comparing the DOM tree of the web page with the DOM tree of each of the plurality of first candidate classifications so as to obtain one or more second candidate classifications matching the DOM tree, wherein the each of the one or more first candidate classifications has the first similarity that is greater than a first threshold value; and performing a similarity analysis to compare the DOM tree of the web page with the DOM of each of the one or more second candidate classifications so as to obtain a second similarity; and selecting one of the one or more second candidate classifications as the specific classification, wherein the selected one has the highest second similarity; (c) retrieving a browsing setting of the specific classification from the style-template database; and (d) viewing the web page according to the browsing setting. (a) obtaining a web page; (b) analyzing the web page to determine a specific classification of the web page according to a URL (Uniform Resource Locator) and contents of the web page; the step (b) comprises the steps of: comparing the URL of the web page with the pattern of each of the plurality of classifications so as to obtain one or more first candidate classifications matching the URL; and performing a similarity analysis to compare the URL of the web page with the pattern of each of the one or more first candidate classifications so as to obtain a first similarity; and the step (b) further comprises the steps of: obtaining a DOM tree of the web page; comparing the DOM tree of the web page with the DOM tree of each of the plurality of first candidate classifications so as to obtain one or more second candidate classifications matching the DOM tree, wherein the each of the one or more first candidate classifications has the first similarity that is greater than a first threshold value; and performing a similarity analysis to compare the DOM tree of the web page with the DOM of each of the one or more second candidate classifications so as to obtain a second similarity; and selecting one of the one or more second candidate classifications as the specific classification, wherein the selected one has the highest second similarity; comparing the URL of the web page with the pattern of each of the plurality of classifications so as to obtain one or more first candidate classifications matching the URL; and performing a similarity analysis to compare the URL of the web page with the pattern of each of the one or more first candidate classifications so as to obtain a first similarity; and obtaining a DOM tree of the web page; comparing the DOM tree of the web page with the DOM tree of each of the plurality of first candidate classifications so as to obtain one or more second candidate classifications matching the DOM tree, wherein the each of the one or more first candidate classifications has the first similarity that is greater than a first threshold value; and performing a similarity analysis to compare the DOM tree of the web page with the DOM of each of the one or more second candidate classifications so as to obtain a second similarity; and selecting one of the one or more second candidate classifications as the specific classification, wherein the selected one has the highest second similarity; (c) retrieving a browsing setting of the specific classification from the style-template database; and (d) viewing the web page according to the browsing setting.