Saving a style

QGIS can save styles in two file formats: QGIS Layer Style File (.qml) and SLD File (.sld). The .qml style file is specific to QGIS, while the .sld style file is usable by other programs to style files. In general, you should plan on saving styles using the .qml file type as it does the best job of saving your styles; however, if portability is a priority, then the .sld file is the better choice. To save a style, open the Layer Properties window, set the style that you wish to save, then go to Style | Save Style and save the style as either a .qml or a .sld file. The saved style file can later be loaded and applied to other data files.

To have a style always apply to the layer you are saving the style from, save the style file as a .qml and give it the same name as the source file. For example, if the shapefile name was Coastlines.shp, then you should save the style file as Coastlines.qml. Creating a style file with the same name has the same effect as setting the default style.